Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #### A ####
- sentence = "Hello World."
- vowels = {"a", "e", "i", "o", "u"}
- stat = {}
- for c in sentence.lower():
- if c in vowels:
- stat[c] = stat.get(c, 0) + 1
- print(stat)
- #### B ####
- sentence = "Hello World."
- vowels = {"a", "e", "i", "o", "u"}
- for v in vowels:
- print(f"{v}: {sentence.lower().count(v)}")
- #### C ####
- sentence = "Hello World."
- print([(x, sentence.lower().count(x)) for x in {"a", "e", "i", "o", "u"}])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement