Commit 1d0ca86d by BellCodeEditor

save project

parent 6546dd65
Showing with 23 additions and 6 deletions
import random
player=input("请猜拳(石头/剪刀/布):")
print("玩家猜拳:"+player)
print("计算机出拳中......")
time.sleep(5)
list=["石头","jian"]
\ No newline at end of file
import time
while True:
player=input("请猜拳(石头/剪刀/布):")
print("玩家猜拳:"+player)
print("计算机出拳中......")
time.sleep(5)
list=["石头","剪刀","布"]
computer=random.choice(list)
print("计算机猜拳"+computer)
if player==computer:
print("平手")
elif player=="石头"and computer=="剪刀":
print("玩家胜")
elif player=="剪刀"and computer=="布":
print("玩家胜")
elif player=="布"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