Commit 1fdbccde by BellCodeEditor

save project

parent 58d531b0
Showing with 11 additions and 6 deletions
...@@ -5,10 +5,14 @@ print("秀儿出拳:"+name) ...@@ -5,10 +5,14 @@ print("秀儿出拳:"+name)
e=["石头","剪刀","布"] e=["石头","剪刀","布"]
e1= random.choice(e) e1= random.choice(e)
print("电脑出拳:"+e1 ) print("电脑出拳:"+e1 )
if name==e1: if name in e :
print("平局")
elif (name=="石头" and e1=="剪刀") or (name=="布" and e1=="石头") or (name=="剪刀" and e1=="布"): if name==e1:
print("赢") print("平局")
else: elif (name=="石头" and e1=="剪刀") or (name=="布" and e1=="石头") or (name=="剪刀" and e1=="布"):
print("输了") print("赢")
else:
print("输了")
else :
print("输错了")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment