Editor settings

General settings

Save settings

Learn to program with Python

Sum of Numbers #

Write a function that takes a list of numbers as the first argument and returns the sum of all the numbers in the list.

We suggest that you do not use the function sum() to complete this challenge and try solving it yourself.

Tests #

  • get_total([0, 0, 0, 0, 0]) should return 0
  • get_total([1, -2, 3, -4, 5]) should return 3
  • get_total([2.5, 1.5, -3.5, 4.5]) should return 5
  • get_total([-10, -20, -30, -40, -50]) should return -150
  • get_total([7]) should return 7
Output will be displayed here