--Originally published at My B10g
This is to simplify the coding and help us se it prettier and easier.
it can get a little bit weird when you think it too much but if it works you can see it ass a for where your code will repeat until you tell him to stop.
i will explain this whit code
def factorial(n):
if n == 1:
return 1
else:
return n * factorial(n-1)
in this case it stops at 1 where when the number gets to 1(the lowest factorial) it stop calling itself what make the code to stop.