0
我目前正在製作一個基於文本的RPG,並且爲了解決在輸入過程中區分大小寫的問題,我使用了.upper使其全部爲大寫。但是,它似乎不適用於我的代碼。有人可以幫忙嗎?.upper命令不工作
if weapon in normalswords or weapon in fireswords or weapon in airswords or weapon in grassSwords:
if weapon in normalswords:
print (normalswords[weapon])
while y== True:
variable= input("Equip? Yes or No")
variable.upper()
if variable== "YES":
print (weapon, "Equipped")
x= False
y=False
elif variable == "NO":
x= True
else:
print ("That is not a valid answer")
y=True