diff --git a/diy1.py b/diy1.py new file mode 100644 index 0000000..6cadb51 --- /dev/null +++ b/diy1.py @@ -0,0 +1,29 @@ +# 利用write()帮助悟空给诺依回信吧~ +import turtle + +pen=turtle.Pen() +screen=turtle.Screen() +len=screen.textinput("提示","你想要多大的爱心") +len1=float(len) +screen.bgcolor("pink") +#设置一个爱心 +pen.fillcolor("red") +pen.begin_fill() +pen.goto(0,0) +pen.setheading(45) +pen.forward(2*len1) +pen.circle(len1,180) +pen.right(90) +pen.circle(len1,180) +pen.forward(2*len1) +pen.end_fill() +#写字 +pen.penup() +pen.goto(100,-100) +pen.pendown() +pen.write("hqs\nwyz\nTom\n你好",font=("Times",30,"normal")) +pen.hideturtle() + + + +turtle.done() \ No newline at end of file