Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw a semicircle in Python turtle only

How to draw a semi circle(half circle) in python turtle only?

I can only use Python turtle. I have try looking for resouces but no luck on finding ones that only use Python turtle.

like image 533
BobTheCat Avatar asked Apr 03 '15 23:04

BobTheCat


3 Answers

See Python turtle reference on circle. For example, for a semi-circle with radius 100 it would be:

import turtle
turtle.circle(100,180)
like image 79
nare Avatar answered Sep 21 '22 12:09

nare


Try the following:

import turtle
t = turtle.Pen()
t.left(90)
for x in range(180):
    t.forward(1)
    t.right(1)
t.right(90)
t.forward(115)
like image 38
Luke Taylor Avatar answered Sep 19 '22 12:09

Luke Taylor


you can also do it just using circle. turtle.circle(radius, extent,steps) eg.

turtle.circle(50,180) # - step is optional 
like image 25
user1113186 Avatar answered Sep 20 '22 12:09

user1113186