我是 Python 新手。我正在编写一个程序来区分单词是否以元音开头。问题是,该程序只能正确处理大写字母作为输入。例如,如果我提供单词“Apple”作为输入,结果是True
; 但是,如果提供单词“apple”作为输入,则结果为False
. 我如何解决它?
word = input ("Please Enter a word:")
if (word [1] =="A") :
print("The word begins with a vowel")
elif (word [1] == "E") :
print("The word begins with a vowel")
elif (word [1] == "I") :
print("The word begins with a vowel")
elif (word [1] == "O") :
print("The word begins with a vowel")
elif (word [1] == "U") :
print("The word begins with a vowel")
else:
print ("The word do not begin with a vowel")