我是python的初学者,它总是说我在第2行、第4行和第10行的输入不好,当我输入一个<;在第二行前面,它批准了它,当我将>;对于第四行,它批准它,我尝试了第十行,但它没有工作
start = int(input("type 1 to begin or 2 to buy items: "))
if start = 1 :
print("welcome to this game")
if start = 2 :
ranged = 0
melee = 1
fighting = 0
money = 100
shop = int(input("1 for sword or two for arrows: "))
if shop = 1 :
money = money-100
fighting = fighting+1
melee = melee+1
start = int(input("type 1 to begin or 2 to buy items: "))
if shop = 2 :
money = money-100
fighting = fighting+0.5
ranged = ranged+1
start = int(input("type 1 to begin or 2 to buy items: "))
else:
print("invalid selection")`
start = int(input('type 1 to begin or 2 to buy items: '))
if start == 1 :
print("welcome to this game")
print("you will face off with a evil monster named york for the first adventure")
print("I am york and I will eat you")
if start == 2 :
x = float(input('type 1 or 2 to buy items: '))
ranged = 0
melee = 1
fighting = 0
money = 100
if x == 1:
money = money-100
print(money)
fighting = fighting+1
melee = melee+1
start = int(input('type 1 to begin or 2 to buy items: '))
if start == 1 :
print("welcome to this game")
else:
print("visit the shop another time")
if x == 2 :
money = money-100
fighting = fighting+0.5
ranged = ranged+1
start = int(input("type 1 to begin or 2 to buy items: "))
Python中的“=”符号用于为变量赋值。 示例:
比较时使用“==”。 示例:
相关问题 更多 >
编程相关推荐