From 46419681685249dda955bae6f4ef4155a34291fa Mon Sep 17 00:00:00 2001 From: RevathiKillampalli Date: Sat, 26 Oct 2024 21:03:23 +0530 Subject: [PATCH] Update sumofnumbers.py --- sumofnumbers.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sumofnumbers.py b/sumofnumbers.py index 5b95001..0769904 100644 --- a/sumofnumbers.py +++ b/sumofnumbers.py @@ -1,12 +1,8 @@ def sum_of_list(lst): total = 0 for num in lst: - total = total + n - return total - total = total + num - return total # Correct capitalization here - total = total + num - return total + total +=num + return total # Test the function print(sum_of_list([1, 2, 3, 4]))