Commit 8da42708 by BellCodeEditor

save project

parent 52e458fc
Showing with 24 additions and 20 deletions
import random
p=input("请出拳:石头/剪刀/布")# 玩家出拳
print("玩家出拳:"+p)
jack=["石头","剪刀","布"]
c=random.choice(jack)
print("计算机出拳:"+c)
if p in jack:
if p==c:
print("平局")
elif p=="剪刀" and c=="布":
print("恭喜你,你赢了")
elif p=="石头" and c=="剪刀":
print("恭喜你,你赢了")
elif p=="布" and c=="石头":
print("恭喜你,你赢了")
else:
print("很遗憾,你输了")
else:
print("输入错误")
\ No newline at end of file
import turtle
#背景颜色
screen=turtle.Screen()
screen.bgcolor("light blue")
#写字
pen=turtle.Pen()
pen.penup()
pen.goto(100,-100)
pen.write("Hi,诺依~\n用python写电子贺卡真是太有趣啦~\n我也喜欢python~\n——悟空 ",font=("Times",20,"normal"))
pen.hideturtle()
#画爱心
len = 60
pen1=turtle.Pen()
pen1.pencolor("red")
pen1.pensize(5)
pen1.left(45)
pen1.forward(len*2)
pen1.circle(len,180)
pen1.right(90)
pen1.circle(len, 180)
pen1.forward(len*2)
pen1.hideturtle()
turtle.done()
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