1、创建python文件,test5circle.py;
2、编写python代码,分别定义颜色、圆的位置、圆的半径等,并进行绘画;
import turtle
turtle.color("blue") #定义颜色
turtle.penup()
turtle.goto(-110,-25)
turtle.pendown()
turtle.circle(45) #圆的半径
turtle.color("black")
turtle.penup()
turtle.goto(0,-25)
turtle.pendown()
turtle.circle(45)
turtle.color("red")
turtle.penup()
turtle.goto(110,-25)
turtle.pendown()
turtle.circle(45)
turtle.color("yellow")
turtle.penup()
turtle.goto(-55,-75)
turtle.pendown()
turtle.circle(45)
turtle.color("green")
turtle.penup()
turtle.goto(55,-75)
turtle.pendown()
turtle.circle(45)
input()
3、右击并选择‘在终端中运行Python文件’选项,执行python代码;
4、查看运行结果,可以发现代码绘制的五环;