Python输入输出练习,运算练习,turtle初步练习

时间:2017-09-06 20:15:24   收藏:0   阅读:394

 

import turtle
turtle.speed(41)
turtle.penup()
turtle.goto(-300,240)
turtle.pendown()
##画国旗背景
turtle.fillcolor(red)
turtle.begin_fill()
turtle.forward(600)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(600)
turtle.right(90)
turtle.forward(400)
turtle.end_fill()
##画大五角星
turtle.penup()
turtle.goto(-263,163)
turtle.pendown()

turtle.color(yellow)
turtle.fillcolor(yellow)
turtle.begin_fill()
turtle.right(90)
for i in range(5):
    turtle.forward(100)
    turtle.right(144)
turtle.end_fill()


##画小五角星
##第一个
turtle.penup()
turtle.goto(-126,211)
turtle.pendown()

turtle.color(yellow)
turtle.fillcolor(yellow)
turtle.begin_fill()
turtle.right(90)
for i in range(5):
    turtle.forward(20)
    turtle.right(144)
turtle.end_fill()
##第二个
turtle.penup()
turtle.goto(-100,160)
turtle.pendown()

turtle.color(yellow)
turtle.fillcolor(yellow)
turtle.begin_fill()
turtle.right(90)
for i in range(5):
    turtle.forward(20)
    turtle.right(144)
turtle.end_fill()
##第三个
turtle.penup()
turtle.goto(-107,116)
turtle.pendown()

turtle.color(yellow)
turtle.fillcolor(yellow)
turtle.begin_fill()
turtle.right(90)
for i in range(5):
    turtle.forward(20)
    turtle.right(144)
turtle.end_fill()
##第四个
turtle.penup()
turtle.goto(-133,95)
turtle.pendown()

turtle.color(yellow)
turtle.fillcolor(yellow)
turtle.begin_fill()
turtle.right(90)
for i in range(5):
    turtle.forward(20)
    turtle.right(144)
turtle.end_fill()

技术分享

 

原文:http://www.cnblogs.com/huanglinxin/p/7483963.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!