python画正方形的代码是甚么?
python画正方形的代码是:
import turtle #导入 turtle.title("画正方形") turtle.pensize(5) #画笔巨细为5 turtle.pencolor("red") #画笔颜色为红 turtle.fillcolor("green") #填充颜色为绿 turtle.begin_fill() #开端填充 for i in range(4): #轮回四次 turtle.forward(200) #行进200 turtle.left(90) #左转90度 turtle.end_fill() #完结填充 turtle.done() #导入完结
保举教程:《python视频教程》
以上就是python画正方形的代码是甚么?的具体内容,更多请存眷资源魔其它相干文章!
标签: Python python教程 python编程 python使用问题 画正方形
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。
抱歉,评论功能暂时关闭!