-1

i am making a code that would help me figure out how many total vowels are in my sequence. My code looks like this

vowel = input("type something: abdc ")

print(*map(vowel.lower().count,"aeiou"))

This kind of code would get me an answer that looks like this "1 0 0 0 0".

This works fine, but the problem is that I want it to show me the total amount of vowels like, this "The amount of vowels in this string is ________. Could anyone help me edit my code to make it like this?

1 Answers1

0

based on what you have you could just do

sum(list(map(vowel.lower().count,"aeiou")))

to convert the map to a list and then sum up all of those values to get the total number of vowels in a string.

Andrew Ryan
  • 1,489
  • 3
  • 15
  • 21