For context, I'm a student learning Python with a lesson package called CodeHS. We were instructed to use Python to draw a target shaped image. This is done by guiding around a sprite on the screen. However, it seems that no matter what it is that I do, I receive an error message on line 4 stating, local variable 'radius' referenced before assignment on line 4 I'm not sure what it is that I'm doing wrong here. If there is someone out there who thinks that they may have an answer that fits this situation, please let me know.
This is my first time posting a question on StackOverflow. Because of this, I may have not given enough information or made myself clear. If this is the case, please let me know. I want to learn:)
Here is an image showing the lesson dashboard if this helps.
Below is a copy of the code I've written.
radius = 25
def target():
for i in range(4):
circle(radius)
right(90)
penup()
forward(25)
pendown()
left(90)
radius = radius + 25
target()
Thanks, everyone!