Ad
Code
Diff
  • def sumd(arr):
        return 0 if not arr else sum(arr) 
    • def sumd(arr):
    • if not arr:
    • return 0
    • result = 0
    • for i in arr:
    • result += i
    • return result
    • return 0 if not arr else sum(arr)