Sum of List
Beginner
Welcome to the jungle of numbers! Today's challenge is to craft a magical Python function that will help you find the sum of a list of numbers. Imagine these numbers are like treasures, and you are the brave coder who collects them!
Let's create a function called sum_of_list which takes a list of numbers as its input. Your goal is to add up all those numbers and return the grand total.
Here's a helpful hint: Python has a built-in function that makes summing numbers as easy as pie.
Example:
sum_of_list([1, 2, 3, 4, 5])
Returns: 15
Another example:
sum_of_list([10, 20, 30])
Returns: 60
Once you master this magic, you'll be able to tackle more lists and bigger numbers! Happy coding! 🧙♂️
Inputs
Arg 1:
[1,2,3,4,5]Expected Output
15Actual Output