利用turtle函数画一个正方形
import turtle as t
pen=turtle.Turtle()
t.forward(200)
t.right(90)
t.forward(200)
t.right(90)
t.forward(200)
t.right(90)
t.forward(200)
t.right(90)
改为循环语句以后:
import turtle as t
pen=t.Turtle()
for i in range(4):
t.forward(200)
t.right(90)
t.speed(1)