Loop within function

Hello, @athpa, and welcome to Python Software Foundation Discourse!

When you post code, please format it correctly for posting, so that essential details such as indentation, quote marks, and other features are displayed properly. The code that you posted is not formatted, and therefore, is difficult to understand. One technique for formatting code is to place lines (fences) of three back ticks before and after the code, as follows:

```
# This is example code.
print("Hello, World!")
```

Note that there is also a </> button at the top of the editing window that will format code, after that code has been selected.

Python is case-sensitive. For example, this will not work:

For i in range(0,6):

Instead, you need:

for i in range(0,6):

You might be interested in visiting the following pages, in order to learn more about this forum: