Python之turtle画奥运五环、斜眼笑脸

源码(详细注释):

import turtle  # 导入turtle库

turtle.width(10)  # 设置画笔粗细为10
turtle.color("blue")  # 设置画笔颜色为‘蓝色·’
turtle.circle(50)  # 画圆半径为50
turtle.penup()  # 抬起画笔
turtle.goto(120, 0)  # 绝对坐标turtle.goto(x,y)
turtle.color("black")  # 设置画笔颜色为黑色
turtle.pendown()  # 下笔
turtle.circle(50)  # 画圆半径为50
turtle.penup()  # 抬笔
turtle.goto(240, 0)  # 坐标(x,y)
turtle.color("red")  # 画笔颜色:红色
turtle.pendown()  # 下笔
turtle.circle(50)  # 画圆半径:50
turtle.penup()  # 抬笔
turtle.goto(60, -45)  # 坐标(x,y)
turtle.color("yellow")  # 颜色:黄色
turtle.pendown()  # 下笔
turtle.circle(50)  # 画圆半径:50
turtle.penup()  # 抬笔
turtle.goto(180, -45)  

你可能感兴趣的:(#,Python-turtle画图,python,turtle)