Commit fd51c5b2 by BellCodeEditor

save project

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