roomChoice = input("Choose 1-3: ")
if roomChoice == 1:
print("You went to the bar, and lost $5, your total loot is : " + main.totalLoot)
else:
print(roomChoice)
roomChoice = input("Choose 1-3: ")
if roomChoice == "1":
print("You went to the bar, and lost $5, your total loot is : " + main.totalLoot)
else:
print(roomChoice)
使用“1”而不是1:
尝试在if语句之前将输入值强制转换为整数。 使用
相关问题 更多 >
编程相关推荐