Beispiele und Musterlösungen
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

santas_house.py 618B

2 months ago
123456789101112131415161718192021222324252627
  1. import math
  2. from turtle import Turtle
  3. def draw_santas_house(turtle, length):
  4. turtle.left(90)
  5. turtle.forward(length)
  6. turtle.right(90)
  7. turtle.forward(length)
  8. turtle.right(90 + 45)
  9. turtle.forward(1.4142 * length)
  10. turtle.left(90 + 45)
  11. turtle.forward(length)
  12. turtle.left(90 + 45)
  13. turtle.forward(1.4142 * length)
  14. turtle.right(45 + 30)
  15. turtle.forward(length)
  16. turtle.right(120)
  17. turtle.forward(length)
  18. turtle.right(30)
  19. turtle.forward(length)
  20. Turtle.draw_santas_house = draw_santas_house
  21. sophia = Turtle()
  22. sophia.draw_santas_house(200)
  23. sophia.screen.mainloop()