# Message from Python discussions

November 2018

— Do you tell me that?

—

I mean..... What gives you more pleasure? Asking in group or just solving it yourself with a little effort?

— Looks like it.

— From swampy.TurtleWorld import *
from math import pi

def polygon(t, length, n):
degrees = 360.0/n;
for i in range(n/2):
fd(t, length)
rt(t, degrees)

def circle(t, r):
lt(t)
circumference = pi*r
n = int(round(circumference))
polygon(t, 1, n)
lt(t)

world = TurtleWorld()
bob = Turtle()
bob.delay = 0.001
while True:
circle(bob,a)

Message permanent page

— I want to draw half circles multiple times

— ```

—

`from swampy.TurtleWorld import *from math import pidef polygon(t, length, n):   degrees = 360.0/n;   for i in range(n/2):      fd(t, length)      rt(t, degrees)def circle(t, r):   lt(t)   circumference = pi*r   n = int(round(circumference))   polygon(t, 1, n)   lt(t)world = TurtleWorld()bob = Turtle()bob.delay = 0.001while True:    a = int(raw_input("Enter the radius"))    circle(bob,a)`

Message permanent page