Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago