赞
踩
五星红旗代码如下:
import turtle as tu
tu.hideturtle() #隐藏海龟
tu.speed(10)
tu.title("Chinese National Flag.") #显示海龟绘图窗口的标题栏文本
n = float(tu.textinput("N","Please enter the times you want.")) #国旗放大的倍数,textinput()函数用于返回用户输入的参数
#旗面
tu.penup()
tu.goto(-150*n,100*n)
tu.pendown()
tu.pencolor("red")
tu.begin_fill()
tu.fillcolor("red")
tu.fd(300*n)
tu.right(90)
tu.fd(200*n)
tu.right(90)
tu.fd(300*n)
tu.right(90)
tu.fd(200*n)
tu.end_fill()
#大星星
tu.penup()
tu.goto(-100*n,80*n)
tu.pendown()
tu.pencolor("yellow")
tu.begin_fill()
tu.fillcolor("yellow")
tu.setheading(-72)
for i in range(5):
tu.fd(57.06*n)
tu.right(144)
tu.end_fill()
#小星星1
tu.penup()
tu.goto(-60*n,70*n)
tu.pendown()
tu.pencolo
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。