标签:python
import random while True : computer =random.randint(0,2) #print(‘computer---->%d‘%computer) player = int(input(‘请选择0,剪刀1,石头,2,布:‘)) if player<=3: if (player==0 and computer==2)or(player==2 and computer==1)or(player==1 and computer==0): print(‘你赢了,我随你玩‘) elif player == computer: print(‘平局,再战300回合‘) else: print(‘你输了,爆你菊花‘) else: print(‘输入错误‘)
本文出自 “11508612” 博客,谢绝转载!
标签:python
原文地址:http://11518612.blog.51cto.com/11508612/1970667