Commit c4a9f2c0 by BellCodeEditor

save project

parent c8136846
Showing with 8 additions and 1 deletions
...@@ -3,5 +3,11 @@ import random ...@@ -3,5 +3,11 @@ import random
d=input() d=input()
print("玩家出拳"+d) print("玩家出拳"+d)
list=["剪刀","石头","布"] list=["剪刀","石头","布"]
comp=random.choice() comp=random.choice(list)
print("计算机出拳"+comp) print("计算机出拳"+comp)
if(d=comp):
print("平局")
elif (d=="剪刀"and comp=="布")or(d=="石头"and comp=="剪刀")or(d=="布"and comp=="石头"):
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