Commit 0391ed74 by BellCodeEditor

save project

parent 07858a54
Showing with 75 additions and 0 deletions
import turtle
import tkinter.messagebox
root = tkinter.Tk()
root.withdraw()
Love_exercise = input("请问您喜欢奥运会吗?(填:喜欢/不喜欢):")
if Love_exercise == '喜欢':
turtle.penup()
turtle.goto(-100,0)
turtle.pendown()
turtle.color("blue")
turtle.circle(70)
turtle.penup()
turtle.forward(150)
turtle.pendown()
turtle.color("black")
turtle.circle(70)
turtle.penup()
turtle.forward(150)
turtle.pendown()
turtle.color("red")
turtle.circle(70)
turtle.right(200)
turtle.penup()
turtle.forward(210)
turtle.pendown()
turtle.color("yellow")
turtle.circle(70)
turtle.left(150)
turtle.penup()
turtle.forward(130)
turtle.pendown()
turtle.color("green")
turtle.circle(70)
tkinter.messagebox.showwarning(title="成功",message="奥运五环绘制成功 !")
else:
tkinter.messagebox.showerror(title="错误的选择",message="不喜欢奥运你看什么奥运五环!")
\ No newline at end of file
# 利用write()帮助悟空给诺依回信吧~
import turtle
#背景
screen=turtle.Screen()
screen.bgcolor("light blue")
#写字
pen=turtle.Pen()
pen.hideturtle()
pen.penup()
pen.goto(100,-100)
pen.write("诺依\n我也会用turtle打字了\n悟空",font=("Times",13,"normal"))
#画爱心
len=screen.textinput("爱心大小框","你想画的爱心大小为?")
lovesize=int(len)
pen1=turtle.Pen()
pen1.hideturtle()
pen1.pensize(10)
pen1.pencolor("red")
pen1.left(45)
pen1.forward(2*lovesize)
pen1.circle(lovesize,180)
pen1.right(90)
pen1.circle(lovesize,180)
pen1.forward(2*lovesize)
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