def func(you,he):
if you == he:
print(f'平局,robot:{he}')
elif you == '布' and he == '石头':
print(f'你赢了,robot:{he}')
elif you == '石头' and he == '剪刀':
print(f'你赢了,robot:{he}')
else:
print(f'你输了,robot:{he}') 本帖最后由 Kelepangxie 于 2020-7-28 18:31 编辑
请问我这个怎么修改,刚学第一天....
print("剪刀=0,石头=1,布=2" "\n" "请输入0,1,2",)
x =int(input() )
import random
xiTong = random.randint(0, 2)
if(xiTong - x ==1 ):
print(xiTong)
print( "you lose")
elif(xiTong - x ==0):
print(xiTong)
print("again")
elif ( x-xiTong == -1):
print(xiTong)
print("you lose")
elifint (x-xiTong ==-2):
print(xiTong)
print("you win")
elifint (x-xiTong ==1):
print(xiTong)
print("you win")
elif int(x - xiTong == 2):
print(xiTong)
print("you win")
elif int(x < 0):
print("请输入数字012")
else:
print("请输入数字012")
页:
[1]