What is the output of print(sum(c in 'aeiou' for c in 'education')) in Python?
print(sum(c in 'aeiou' for c in 'education'))
Correct answer
D. 5
6 views
D. 5
6 views
Counting vowels with sum and a generator.
Asked in: Python Interview Strings
https://docs.python.org/3/library/stdtypes.html#string-methodsNot sure why the answer is D? Ask here and get an explanation.