fork download
  1. # your code goes here
  2. import turtle
  3. import math
  4.  
  5. def DrawCircle(diameter, turns=360):
  6. angle = 360 / turns
  7. distance = diameter * math.pi / turns
  8. print turtle.xcor(), turtle.ycor()
  9. turtle.forward(distance/2)
  10. for i in range(turns):
  11. turtle.right(angle)
  12. turtle.forward(distance)
  13. turtle.backward(distance/2)
  14. print turtle.xcor(), turtle.ycor()
  15.  
Runtime error #stdin #stdout #stderr 0.09s 8084KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 2, in <module>
    import turtle
  File "/usr/lib/python2.7/lib-tk/turtle.py", line 107, in <module>
    import Tkinter as TK
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
    raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package