Commit fab291dd by BellCodeEditor

save project

parent c261b0e2
Showing with 9 additions and 3 deletions
import random import random
choice=random.choice()
yjy=input("石头、剪刀、布") yjy=input("石头、剪刀、布")
print("玩家出拳:"+yjy) print("玩家出拳:"+yjy)
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
p=random.choice(list) sybs=random.choice(list)
print("人机出拳:"+p) print("人机出拳:"+sybs)
if yjy==sybs:
print("平局")
elif (sybs=="剪刀" and yjy=="石头")or(sybs=="石头"and yjy=="布")or(sybs=="布"and yjy=="剪刀"):
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