def sum_func(a):
if type(a) is int:
if a < 0:
return -1
else:
sum = 0
integer = 0
while integer <= a:
sum = sum + integer
integer = integer + 1
return sum
else:
return -1
why are we taking while loop and integer,sum ??