Commit 05aff723 by BellCodeEditor

save project

parent fd535ea8
Showing with 29 additions and 19 deletions
# 利用write()帮助悟空给诺依回信吧~
import turtle
turtle.colormode(255)
s = turtle.Screen()
s.bgcolor((135,206,255))
p1 = turtle.Pen()
p1.penup()
p1.goto(-100,-150)
p1.write("诺伊,\nturtle真好用!\n我也会做贺卡啦!",font = ("宋体",20,"normal"))
p1.hideturtle()
turtle.colormode(255) import turtle
s = turtle.Screen()
str1 = s.textinput("提示","你想要多大的爱心?")
c = int(str1)
print(type(str1))
p2 = turtle.Pen() p2 = turtle.Pen()
p2.pensize(10)
p2.pencolor((255,192,203))
def huayuan(a): def huayuan(a):
p2.setheading(45) p2.setheading(45)
p2.forward(a) p2.forward(a)
...@@ -28,6 +17,28 @@ def huayuan(a): ...@@ -28,6 +17,28 @@ def huayuan(a):
p2.forward(a) p2.forward(a)
p2.hideturtle() p2.hideturtle()
huayuan(100) huayuan(c)
turtle.done()
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