hi guys can you please help me understand the difference bteween these 2 codes?
my interpretation is def function has a loop in it (im not smart)
and
thanks for helping me
my interpretation is def function has a loop in it (im not smart)
def func(x): res = 0 for i in range(x): res += i return res print(func(5))output is 10
and
def func(x): for i in range(x): res = 0 res += i return res print(func(5))output is 4
thanks for helping me