Commit 424b07b8 by BellCodeEditor

save project

parent 84fa03eb
Showing with 16 additions and 1 deletions
import random
pp = input("请出拳:剪刀/石头/布")
print("玩家输入"+pp)
list=["剪刀","石头","布"]
cc=random.choice(list)
print("电脑输入"+cc)
if pp in list:
if pp==cc:
print("平局")
elif (pp=="剪刀" and cc=="布")or(pp=="布" and cc=="石头")or(pp=="石头" and cc=="剪刀"):
print("玩家赢")
else
print("你输了")
else:
print("输入错误")
...@@ -6,7 +6,7 @@ computer=random.choice(list) ...@@ -6,7 +6,7 @@ computer=random.choice(list)
print(computer) print(computer)
if player==computer if player==computer
print("平局") print("平局")
elif (player=="剪刀" and computer=="布")or(player=="") elif (player=="剪刀" and computer=="布")
print("玩家赢") print("玩家赢")
else else
print("电脑赢") print("电脑赢")
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