python学习笔记:turtle库绘制正方形

turtle正方形绘制

import turtle as t

t.setup(600,600)
t.penup()
t.goto(-150,150)
t.pendown()
t.pensize(2)
t.pencolor(0,0,0)
for i in range(4):
    t.fd(300)
    t.right(90)
t.done()
发布了51 篇原创文章 · 获赞 34 · 访问量 902

猜你喜欢

转载自blog.csdn.net/weixin_43412569/article/details/104857298