Commit 973db63b by BellCodeEditor

save project

parent c84dc40f
Showing with 11 additions and 7 deletions
...@@ -7,17 +7,20 @@ import random ...@@ -7,17 +7,20 @@ import random
listl=["石头","剪刀","布"] listl=["石头","剪刀","布"]
r=random.choice(listl) r=random.choice(listl)
print("计算机出拳:"+r) print("计算机出拳:"+r)
if p==r: if p in listl:
if p==r:
print("平局了") print("平局了")
elif p=="石头" and r=="剪刀": elif p=="石头" and r=="剪刀":
print("赢了") print("赢了")
elif p=="布" and r=="石头": elif p=="布" and r=="石头":
print("赢了") print("赢了")
elif p=="剪刀" and r=="布": elif p=="剪刀" and r=="布":
print("赢了") print("赢了")
elif p=="布" and r=="剪刀": elif p=="布" and r=="剪刀":
print("输了") print("输了")
elif p=="石头" and r=="布": elif p=="石头" and r=="布":
print("输了") print("输了")
elif p=="剪刀" and r=="石头": elif p=="剪刀" and r=="石头":
print("输了") 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