Draw squares in turtle library in Python
import turtle as t#Give the turtle library an nickname of t
for i in range(2):#Use a for loop to traverse
t.forward(50)
#Draw a line according to the front angle t.right(90)#The brush rotates to the right
t .backward(50)
#Draw a line according to the right rear angle t.right(90)
#The brush rotates to the right t.done()#Keep the window = turtle.done()
Actually it's almost the same as drawing a triangle