Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions sumofnumbers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
def sum_of_list(lst):
total = 0
for num in lst:
total = total + num
return total

total +=num
return total

# Test the function
print(sum_of_list([1, 2, 3, 4]))
print(sum_of_list([1, 2, 3, 4, 5]))
Expand Down