Python实现简单的石头剪刀布小游戏

import random

person = int(input('请输入石头[0],剪刀[1],布[2]:'))
computer = random.randint(0,2)

print('机器人输入的是:%d'%(computer))

if person == 0 and computer == 1:
    print('你赢了')
elif person == 1 and computer == 2:
    print('你赢了')
elif person == 2 and computer == 0:
    print('你赢了')
elif person == computer:
    print('平手')
else:
    print('你输了')
上一篇:编写一个Python程序,实现从键盘上输入3个整数并将这3个数由小到大输出。


下一篇:YOLOv1学习记录