我写了一个简单的爱程序,其中对于每个元音,用户得分最后输出的点。代码中有一个未知错误,我无法注意到这一点,如果有人可以指出这一点,我将不胜感激。
awesome=0
name=input("Enter your name, wasteman")
for char in name:
if char in ["a","e","i","o",u"]:
awesome += 1
print("your awesome level is: " + str(awesome))
答案 0 :(得分:2)
["a","e","i","o",u"] <- missing opening quote around `u`
应该是:
["a","e","i","o","u"]