How to Make a Target with Python: Any Tips or Step-by-Step Guides?

16 Replies, 1885 Views

Hey! I’ve done something similar before using the turtle library. It’s super beginner-friendly and great for drawing shapes like targets. You can create concentric circles by looping and adjusting the radius. Here’s a quick snippet to get you started:

```python
import turtle

t = turtle.Turtle()
t.speed(0)
colors = ["red", "white", "red", "white", "red"]

for i in range(5):
t.color(colors[i])
t.begin_fill()
t.circle(50 + i*20)
t.end_fill()
t.penup()
t.goto(0, -20*(i+1))
t.pendown()

turtle.done()
```

This draws a simple target with alternating red and white rings. Let me know if you need help tweaking it!

Messages In This Thread



Users browsing this thread: 1 Guest(s)