Commit 4ebe862f by BellCodeEditor

save project

parent 43d74809
Showing with 15 additions and 5 deletions
#mj=input("输入剪刀/石头/布") player=input("输入剪刀/石头/布")
#print("玩家出拳"+mj) print("玩家出拳:"+player)
import random import random
a=["剪刀","石头","布"] a=["剪刀","石头","布"]
dn=random.choice(a) mj=random.choice(a)
print(dn) print("电脑出拳:"+mj)
\ No newline at end of file if player in a:
if player==mj:
print("平局")
elif (player=="石头"and mj=="剪刀") or (player=="剪刀" and mj=="布")or (player=="布" and mj=="石头"):
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