这个简单的Python脚本不起作用。你知道吗
import time
import random
callingcard = ('BootsOnTheGround', 'TitanBaseCamp', 'TitanFacility',
'TitanicStorm', 'TitanicCanyon', 'TitanSandstorm', 'ToTheShip',
'AsteroidMines', 'TheSteelDragon', 'C6Assembly', 'C12Patrol')
weapons = ('Rack-9', 'Karma-45', 'NV-4', 'R3K', 'KBAR- 32', 'Trencher', 'Type-2', 'Volk', 'ERAD', 'FHR40', 'RPR Evo', 'KBS Longbow', 'DMR-1', 'Widowmaker', 'Banshee', 'DCM-8', 'Reaver', 'RAW', 'Mauler', 'Titan', 'EMC', 'Oni', 'Kendall 44', 'Hailstorm', 'OSA', 'MacTav-45', 'TF-141', 'S-Ravage', 'M1', 'Hornet', 'Spartan SA3', 'P-LAW', 'Howitzer')
while True:
print("Open Supply Drop?.")
answer = input().lower()
if answer == "yes":
print("Weapons or Calling Card?")
answer1 = input().lower()
if answer1 == "Calling Card":
print("Please wait 3 seconds...")
time.sleep(3)
print(random.choice(callingcard))
elif answer1 == "Weapons":
print ("Please wait 3 seconds...")
time.sleep(3)
print(random.choice(weapons))
else:
print("Please wait 3 seconds...")
time.sleep(3)
break
else:
print("Please wait 3 seconds...")
time.sleep(3)
您正在检查answer1==“Weapon1”,但在此之前您将其改为小写。你知道吗
所以,要么移除
answer1.lower()
,要么选中answer1 == "weapon1"
那就行了。。。你知道吗您将输入作为
answer1 = input().lower
并将其更改为小写,因此它与任何条件都不匹配。将其更改为answer1 = input()
。你知道吗我已经编辑了你的代码。你知道吗
相关问题 更多 >
编程相关推荐