Objective
Create a Python program that asks the user for 5 integers and stores them in a list. Then, implement a function called add_numbers that receives the list and returns the sum of its elements. Finally, display the result.
Instructions
- In the
mainfunction, ask the user for 5 integers and store them in a list. - Implement the function
add_numberswith the list as a parameter. It calculates the sum of the numbers. - Print the result of the sum on the screen.
5
2
5
3
1
16
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise