Commit fd51c5b2 by BellCodeEditor

save project

parent 65e1edab
Showing with 17 additions and 7 deletions
import random# 玩家出拳 import random
superhand=input("你要出什么(石头、剪刀、布)?") while True:# 玩家出拳
print("玩家出:"+superhand) superhand=input("你要出什么(石头、剪刀、布)?")
list=("石头","剪刀","布") print("玩家出:"+superhand)
inh=random.choice(list) list=("石头","剪刀","布")
print("computer put "+inh) computer=random.choice(list)
\ No newline at end of file print("computer put "+computer)
if superhand == computer:
print("呵呵,我们打了个平局")
elif superhand=="剪刀" and computer=="布":
print("你赢了")
elif superhand=="布" and computer=="石头":
print("你赢了")
elif superhand=="石头" and computer=="剪刀":
print("你赢了")
else:
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