+ 1
I don't understand this, what does this do?
def func(x): res = 0 for i in range(x): res += i return res print(func(4))
3 Answers
+ 4
Maybe python would be a good tag for the question.
+ 4
func(x) gives the sum of numbers from 0 to x-1.
+ 1
For future reference, please tag a relevant language to improve context clarity ... â