Commit 06fa1fa7 by BellCodeEditor

auto save

parent 448599a7
Showing with 16 additions and 0 deletions
player = input("请输入你要出的拳(石头/剪刀/布)")
print("玩家出拳"+ player)
#电脑出拳
import random
list1 = ["石头","剪刀","布"]
cmp= random.choice(list1)
print("电脑出拳:"+ cmp)
#比较结果
if cmp == player:
print("平局")
elif player=="石头"and cmp=="剪刀" or player=="剪刀"and cmp=="布" or player=="布" and cmp=="石头":
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