python--石头剪刀布游戏
程序员文章站
2022-06-16 23:05:24
...
import random
print("\n石头=1","剪刀=2","布=3\n")
my = int(input("请大哥出拳:"))
PC = random.randint(1,3)
print("\n您出的%d,电脑出的%d"%(my,PC))
if(my==1 and PC==2) or (my==2 and PC==3) or (my==3 and PC==1):
print("\n电脑都能打败,小弟甘拜下风!\n")
elif my==PC:
print("\n竟然平局了,不算,再来!")
else:
print("\n棋逢对手,再来大战三百回合!!!\n")