一起学python红绿灯视频程序代码
一、用不同的turtle库导入模式绘制五角星
importturtle
importturtleasp02
fromturtleimport*
defwjx01(c):
p01=turtle.Turtle()
p01.pensize(3)
p01.pencolor("#")
p01.up()
p01.goto(-,0)
p01.down()
foriinrange(5):
p01.fd(c)
p01.rt()
defwjx02(c):
p02.pensize(3)
p02.pencolor("#")
p02.up()
p02.goto(0,0)
p02.down()
foriinrange(5):
p02.fd(c)
p02.rt()
defwjx03(c):
pensize(3)
pencolor("#")
up()
goto(,0)
down()
foriinrange(5):
fd(c)
rt()
defmain():
wjx01()
wjx02()
wjx03()
if__name__=="__main__":
main()
转载请注明:http://www.abuoumao.com/hyfw/4631.html