python画五星红旗
⼼⾎来潮突然想⽤python画⼀⾯五星红旗,由于我对程序的掌握还不是特别全⾯不知道怎么缩短,所以代码⽐较多,还有五⾓星的代码也是参考其他⼈的。整个程序都是以坐标绘图为主是⽐较基础的,还有五⾓星也是。以下是原代码,可以直接⾷⽤
import turtle
turtle.fillcolor("red")
turtle.begin_fill()
turtle.penup()
<(-60,0)
turtle.pendown()
<(-60,160)
<(240,160)
<(240,0)
<(-60,0)
import turtle
turtle.penup()
<(-50,110)
turtle.fillcolor("yellow")
turtle.begin_fill()
count = 1
while count <= 5:
turtle.forward(45)
turtle.right(144)
count += 1
import turtle
turtle.penup()
<(-10,145)
turtle.fillcolor("yellow")
turtle.begin_fill()
count = 1
while count <= 5:
turtle.forward(20)
turtle.right(144)
count += 1
import turtle
turtle.penup
<(10,120)
turtle.fillcolor("yellow")
turtle.begin_fill()
count = 1
while count <= 5:
turtle.forward(20)
turtle.right(144)
count += 1
import turtle
turtle.penup()
<(10,95)
turtle.fillcolor("yellow")
react状态管理turtle.begin_fill()
手机端如何调整网页源码
count = 1
while count <= 5:
turtle.forward(20)
局部变量和临时变量的区别
turtle.right(144)
提交按钮居中count += 1
import turtle
turtle.up()
<(-10,70)strcmp怎么发音
turtle.fillcolor("yellow")
turtle.begin_fill()
count = 1
while count <= 5:
turtle.forward(20)
turtle.right(144)
count += 1
import turtle
python代码画图案turtle.fillcolor("grey")
turtle.begin_fill()
turtle.penup()
<(-60,170)
turtle.pendown()
<(-70,170)
<(-70,-450)
<(-60,-450)
<(-60,170)
import turtle
turtle.fillcolor("grey")
turtle.begin_fill()
turtle.penup()
<(-65,170)
turtle.pendown()
turtle.circle(10)
效果还是挺好的,⼿已经残了就不加说明注释了

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。