You can print in next line with \n new line character. It is your choise to keep whatever you want.Good luck
It takes 2 times less than the original code. It your choice to keep whichever code you want. Good luck
def sumi(arr): # parity: sum([]) == 0 #try: return arr.pop(0) + sumi(arr) #except: return 0 sum=0 for i in range(len(arr)): sum+=arr[i] i+=1 return sum
- def sumi(arr): # parity: sum([]) == 0
try: return arr.pop(0) + sumi(arr)except: return 0- #try: return arr.pop(0) + sumi(arr)
- #except: return 0
- sum=0
- for i in range(len(arr)):
- sum+=arr[i]
- i+=1
- return sum