Ruben Ruben - 1 year ago 90
Python Question

Print only vowels in a string

I am new in Python and I'm trying to print all the vowels in a string. So if someone enters "Hey there, everything alright?" , all vowels needs to be printed...but I don't know how? (so it's not about counting the vowels, its about printing the vowels)

For now I've got this ;

sentence = input('Enter your sentence: ' )

if 'a,e,i,o,u' in sentence:


Answer Source

Something like this?

sentence = input('Enter your sentence: ' )
for letter in sentence:
    if letter in 'aeiou':
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download