Commit c72d059b by BellCodeEditor

save project

parent 901feac7
Showing with 7 additions and 3 deletions
...@@ -6,9 +6,12 @@ import random ...@@ -6,9 +6,12 @@ import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
yy=random.choice(list) yy=random.choice(list)
print("计算机出拳:"+yy) print("计算机出拳:"+yy)
if xx==yy: if xx in list:
if xx==yy:
print("平手") print("平手")
elif (xx=="石头" and yy=="剪刀")or(xx=="剪刀" and yy=="布")or(xx=="布" and yy=="石头"): elif (xx=="石头" and yy=="剪刀")or(xx=="剪刀" and yy=="布")or(xx=="布" and yy=="石头"):
print("赢") print("赢")
else: else:
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