Commit bdd87dab by BellCodeEditor

save project

parent 363e35b1
Showing with 7 additions and 25 deletions
# 利用write()帮助悟空给诺依回信吧~ username="diy"
import turtle userpassword="12345"
screen=turtle.Screen() name=input("请输入用户名")
screen.bgcolor("pink") password=input("请输入密码")
pen=turtle.Pen() if name==username and password==userpassword:
pen.penup() print("登录成功")
pen.goto(100,-100)
pen.write("诺依,你好呀,\n 我是贝尔星球的孙悟空,\n 我喜欢编程。\n",font=("Times",17,"normal"))
pen.hideturtle()
# 画爱心
len=60
pen1=turtle.Pen()
len=screen.textinput("提示","你要画多大的爱心?")
a=int(len)
pen1.pensize(5)
pen1.pencolor("red")
pen1.left(45)
pen1.forward(2*a)
pen1.circle(a,180)
pen1.right(90)
pen1.circle(a,180)
pen1.forward(2*a)
pen1.hideturtle()
turtle.done()
\ 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