Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Sample list programs Write a function called negate(myList) which takes in a list of numbers as a parameter and negates each value in the list.
Sample list programs Write a function called negate(myList) which takes in a list of numbers as a parameter and negates each value in the list. Since the function changes the list provided as a parameter it does not need to return anything Write a function called negativeCopy(myList), which takes in a list of numbers as a parameter and returns a newly created list, which is, contains the negative values of the original list. For example, For example, negativeCopy(1 -2, 3.5 4.2,] ) would return [-1, 2, -3.5, -4.2] Write a function called addList(myList, addend), which takes in a list of numbers and a single addend as parameters. The function returns a newly created list, which is each number in the original list plus, the addend. For example addList 1,2,3.5,4.2], 3) would return [4, 5, 6.5, 7.2]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started