There exist different kind of repetition that you can use in python; you can use loops (if, for or while) and recursion, I already explained them in my previous blogs. In this blog I am going to cover the subject of when using what kind of repetition.
First the loops. You use the if loop if you want to execute something if the condition is met. So that one is quite obvious when to use. Then you have the for loop and that is a definite loop that is repeating as long as the restricted condition in the for is met. The last loop is the while loop and that is a indefinite loop that keeps running as long as the condition is met.
Than the other category is the recursion. With recursion you are all the time calling the function again in its own body. With recursion you are making more use of the function then of variables with an amount.
Example on how to use them all:

In this video you can see it as well playing if you prefer that.
Hopefully you understand the differences between loops and recursion after this blog and thanks for reading!