import turtle def Rect(): t.color('red', 'red') t.begin_fill() t.pd() for i in range(2): t.fd(100) t.lt(90) t.fd(40) t.lt(90) t.up() t.end_fill() t = turtle.Turtle() Rect() turtle.done()