或声明不正常

时间:2015-04-23 20:11:52

标签: python

请帮我解决这个问题

# 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

您好!

我有这段小代码,它有效,但它并不是我认为它应该如何。例如,当我输入单词sta时,结果为:

It contains a vowel
It contains a wwwwovel.

另一方面,当我输入sto时,答案是:

It contains a vowel

当我输入sta时,程序应打印与sto相同的结果。 请帮帮我。

谢谢!

0 个答案:

没有答案