Commit 5a6f574d by BellCodeEditor

save project

parent 937fd74b
Showing with 6 additions and 21 deletions
# 玩家出拳 import turtle
player=input("你想出哪个/石头/剪刀/布?") pen=turtle.Pen()
print("player出拳:"+player) pen.write("Hi,洛伊~\n用python写电子贺卡真是太有趣啦\n我也很喜欢python~\n--悟空",font=("times",18,"normal"))
import random pen.hideturtle()
list=["石头","剪刀","布"] turtle.done()
computer=random.choice(list) \ No newline at end of file
print(computer)
if player in list:
if player==computer:
prnt("平局")
elif player=="石头" and computer=="剪刀":
print("恭喜,你赢了")
elif player=="剪刀" and computer=="布":
print("恭喜,你赢了")
elif player=="布" and computer=="石头":
print("恭喜,你赢了")
else:
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