赞
踩
展开全部
1、创建python文件,test5circle.py;
2、编写python代码,分别定义颜色、圆62616964757a686964616fe59b9ee7ad9431333433623136的位置、圆的半径等,并进行绘画;
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、查看运行结果,可以发现代码绘制的五环;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。