from turtle import * def o_circle(r): #pd() circle(r,90) circle(r,180) circle(r,90) def o_letter(h): a=h*0.2 r=h/2 pu() fd(r) fillcolor("white") begin_fill() o_circle(r) end_fill() pu() goto(xcor(),ycor()+a) fillcolor("red") begin_fill() o_circle(r-a) end_fill() pu() goto(xcor()+r,ycor()-a) def r_letter(h): cor=pos() [x,y]=cor a=h*0.2 lt(90) #pd() fillcolor("white") begin_fill() fd(h) rt(90) fd(a+h/4) circle(-h/3,150) pu() circle(-h/3,30) cor1=pos() [x1,y1]=cor1 circle(-h/3,-30) #pd() seth(180) goto(x+h*0.8,y) fd(a) goto(x1,y1) fd(h/4) lt(90) fd(h/3) lt(90) bk(a) end_fill() pu() goto(x,y+h-a) fd(a) #pd() fillcolor("red") begin_fill() fd(h/4) circle(-h/3+a,180) fd(h/4) goto(xcor(),y+h-a) end_fill() pu() goto(x+h,y) seth(0) def square(h,b): for i in range(2): fd(b) lt(90) fd(h) lt(90) def f_letter(h): a=h*0.2 fillcolor("white") begin_fill() square(h, a) cor=pos() [x,y]=cor goto(x,y+h-a) square(a,h-a) goto(x,y+h/3) square(a,3*a) end_fill() speed(6) tracer(0) pu() fillcolor("red") begin_fill() goto(-350,-100) square(500,1090) end_fill() pu() goto(-250,0) #bk(500) o_letter(300) fd(50) r_letter(300) f_letter(300) ht() tracer(1) exitonclick()