Commit 8edd4a1b by BellCodeEditor

save project

parent 01180cf9
Showing with 3 additions and 2 deletions
import random
player = input("出拳:(石头/剪刀/布):") player = input("出拳:(石头/剪刀/布):")
print("出拳:"+player) print("出拳:"+player)
list = ["石头""剪刀""布"] list = ["石头","剪刀","布"]
cp = random.choice(list) cp = random.choice(list)
print("电脑出拳:"+cp) print("电脑出拳:"+cp)
if player==cp: if player==cp:
print("平局") print("平局")
elif player=="石头" and cp=="剪刀" or player=="剪刀" and cp=="布" or elif player=="石头" and cp=="剪刀" or player=="剪刀" and cp=="布" or player=="布" and cp=="石头"
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