Commit 7c3d53c3 by BellCodeEditor

save project

parent c67cf03c
Showing with 7 additions and 0 deletions
...@@ -5,3 +5,9 @@ list=["石头","剪刀","布"] ...@@ -5,3 +5,9 @@ list=["石头","剪刀","布"]
import random import random
computer=random.choice(list) computer=random.choice(list)
print("计算机出"+computer) print("计算机出"+computer)
if play==computer:
print("平局")
elif (play=="石头" and computer=="剪刀")or(play=="剪刀" and computer=="布")or(play=="布" and computer=="石头") :
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