17 lines
515 B
Python
17 lines
515 B
Python
def count(s):
|
|
"""Count three things in a sentence and return a dict.
|
|
|
|
Keys:
|
|
"length" — total characters in s (including spaces)
|
|
"words" — number of whitespace-separated words
|
|
"a_count" — count of lowercase 'a's after lowercasing s
|
|
|
|
Helpers:
|
|
len(s) — char count
|
|
len(s.split()) — word count
|
|
s.lower().count("a") — number of 'a's, case-insensitive
|
|
|
|
count("Hello andromeda") -> {"length": 15, "words": 2, "a_count": 2}
|
|
"""
|
|
pass
|