import turtle
t=turtle.Turtle()
def draw_rectangle(t,w,h,size,color,fill):
t.begin_fill()
t.pensize(size)
#t.shapesize(5,5,5)
t.pencolor(color)
t.fillcolor(fill)
t.fd(w)
t.rt(90)
t.fd(h)
t.rt(90)
t.fd(w)
t.rt(90)
t.fd(h)
turtle.bgcolor("yellow")
t.end_fill()
draw_rectangle(t,200,100,5,"blue","green")
turtle.done()
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter