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.

zielscheibe.py 533B

2 months ago
1234567891011121314151617181920212223242526
  1. from turtle import Turtle
  2. def draw_archery_target(turtle):
  3. draw_circle(turtle, 30, 'red')
  4. draw_circle(turtle, 20, 'white')
  5. draw_circle(turtle, 10, 'red')
  6. def draw_circle(turtle, radius, color):
  7. turtle.fillcolor(color)
  8. turtle.pencolor(color)
  9. turtle.begin_fill()
  10. turtle.pendown()
  11. turtle.circle(radius)
  12. turtle.penup()
  13. turtle.end_fill()
  14. turtle.left(90)
  15. turtle.forward(10)
  16. turtle.right(90)
  17. sophia = Turtle()
  18. draw_archery_target(sophia)
  19. sophia.hideturtle()
  20. sophia.screen.mainloop()