1

Please help me with this problem

# something about if/else and strings

# we ask the user for input
print "Enter something"
text = raw_input("> ")


# Let's see if it contains a vowel
for i in text:
    if i in "aeiou":
        print "It contains a vowel"
        break

for i in text:
    if i == ("a" or "e" or "i" or "o" or "u"):
        print "It contains a wwwwovel."
        break

Hello!

I have this little piece of code, it works, but it doesn't how I suppose it should. For example, when I type in the words sta, the result is:

It contains a vowel
It contains a wwwwovel.

On the other hand, when I type sto, the answer is:

It contains a vowel

The program should print the same results as sta when I type sto. Please help me.

Thank you!

hex
  • 13
  • 4

0 Answers0