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.

germany.py 576B

2 months ago
123456789101112131415161718192021222324252627282930313233343536
  1. # Zeichnen der Flagge Deutschlands mit der Turtle
  2. from turtle import *
  3. def draw_rectangle(width, height):
  4. begin_fill()
  5. forward(width)
  6. right(90)
  7. forward(height)
  8. right(90)
  9. forward(width)
  10. right(90)
  11. forward(height)
  12. right(90)
  13. end_fill()
  14. def next_shape():
  15. penup()
  16. right(90)
  17. forward(50)
  18. left(90)
  19. pendown()
  20. pencolor('Black')
  21. fillcolor('Black')
  22. draw_rectangle(200, 50)
  23. next_shape()
  24. pencolor('Red')
  25. fillcolor('Red')
  26. draw_rectangle(200,50)
  27. next_shape()
  28. pencolor('Yellow')
  29. fillcolor('Yellow')
  30. draw_rectangle(200,50)
  31. done()