fork download
  1.  
  2. import turtle
  3. import math
  4.  
  5. def tail_triangle1(z,x):
  6. turtle.up()
  7. turtle.setpos(z,x)
  8. turtle.down()
  9. turtle.right(135)
  10. turtle.forward(50)
  11. turtle.right(45)
  12. turtle.forward(sqrt(5000))
  13. turtle.right(45)
  14. turtle.forward(50)
  15. pass
  16.  
  17. def tail_triangle2(c,d):
  18. turtle.up()
  19. turtle.setpos(c,d)
  20. turtle.down()
  21. turtle.right(90)
  22. turtle.forward(sqrt(5000))
  23. turtle.right(45)
  24. turtle.forward(50)
  25. turtle.right(90)
  26. turtle.forward(50)
  27. pass
  28.  
  29. def tail(a,b):
  30. turtle.up()
  31. turtle.setpos(a,b)
  32. turtle.down()
  33. turtle.right(45)
  34. turtle.forward(50)
  35. turtle.right(90)
  36. turtle.forward(50)
  37. turtle.right(90)
  38. turtle.forward(50)
  39. turtle.right(90)
  40. turtle.forward(50)
  41. pass
  42.  
  43. tail_triangle1(146,475)
  44. tail_triangle2(75,475)
  45. tail(50,400)
  46. turtle.done()
Runtime error #stdin #stdout #stderr 0.02s 13868KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 43, in <module>
  File "prog.py", line 6, in tail_triangle1
  File "<string>", line 6, in up
  File "/usr/lib/python2.7/lib-tk/turtle.py", line 3703, in __init__
    Turtle._screen = Screen()
  File "/usr/lib/python2.7/lib-tk/turtle.py", line 3553, in Screen
    Turtle._screen = _Screen()
  File "/usr/lib/python2.7/lib-tk/turtle.py", line 3569, in __init__
    _Screen._root = self._root = _Root()
  File "/usr/lib/python2.7/lib-tk/turtle.py", line 458, in __init__
    TK.Tk.__init__(self)
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1828, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable