I am a noob, just when I thought I was getting a hang of loops, it had to throw me a curve ball. And I cannot find an answer anywhere.
I have a very simple for loop inside a function. All it does is counts i in a range and prints i. Then I call the function, and instead of printing, eg., 0, 1, 2, 3, 4 it prints 0, 1, 2, 3, 4, None.
I wrote the following code:
`
def generate():
for i in range(5):
print(i)
print(generate())
`
If I do this code without the function, just with the for loop, it works fine.