Question: Write a function called addListNums ( ) that accepts a list of numbers. The function should return the sum of the first, third, and last

Write a function called addListNums()that accepts a list of numbers. The function should return the sum of the first, third, and last item in the list. You may assume that the list that is passed to that function contains at least 2 numbers in it. For example, addListNums([3,4,5,6]) would return 14(i.e. adds the first item in the list, 3, to the third item, 5, and the last item 6, and returns the sum).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!