The range()
function returns a series of numbers on first instance. In your case, from 0 to n-1. So, if you call bigAdd(10)
, you'll get numbers from 0 to 9.
The function then increments the originally-input number (in your case, 10) by the sum of all the smaller numbers (in this case, 0 + 1 + ... + 9) which is 45.
So, adding the 45 to the original 10 gives you 55.