Commit fa2bf2a7 by BellCodeEditor

save project

parent 978385cf
Showing with 13 additions and 3 deletions
name=input("请出(石头/剪刀/布)") name=input("请出(石头/剪刀/布)")
print("玩家:"+name) print("玩家:"+name)
import random import random
a=["(石头/剪刀/布)"] a=["石头","剪刀","布"]
com=random.choice(a) ai=random.choice(a)
print("人机:"+com) print("人机:"+ai)
if name=="石头"and ai=="石头":
print("平局")
elif name=="布"and ai=="石头":
print("玩家赢!")
elif name=="石头"and ai=="剪刀":
print("玩家赢!")
else name=="石头"and ai=="布":
print("人机赢!")
elif name=="剪刀"and ai=="布":
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