subject

Write and test a program to sum and modify a list of numbers. The program will have two functions: sumList(nums) is a function to sum numbers in a list and return the sum squareEach(nums) is a function that modifies the list by squaring each entry The main program should prompt the user for a number n, and use that to create a list of numbers, nums (see ch6ex12.py). It will then make a call to sumList(nums), then make a call to squareEach(nums), and then call sumList(nums) a second time. The program should print the original list, the sum of the original list, the list after being squared, and the sum of the elements in the updated list. Remember that squaring a number means multiplying it by itself; so if I pass you a 7, you need to return it as a 49 (7*7) Test your program with list [1,2,3,4,5,6,7,8], which should print a sum of 36, a list [1,4,9,16,25,36,49,64], and a second sum 204 Save this as lastname_program5.py and submit on Brightspace You must submit your source code as a .py file. The code should be well-structured and commented. A screen shot of the program displaying all required output FOR EACH FEATURE OF YOUR PROGRAM and your name, class, and program number

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. a company wants to use online methods to target more customers. it decides to conduct a market research by collecting the data of a few customers with their consent. they want to track data of the sites that their customers frequently visit. which software can the company? a. spyware b. bots c. adware d. trojan horse e. rootkits
Answers: 1
question
Computers and Technology, 23.06.2019 16:10
What is the ooh? a. omaha occupation handbook b. online occupational c. occupations online d. occupational outlook handbook select the best answer from the choices provided
Answers: 3
question
Computers and Technology, 25.06.2019 03:30
Which task should happen during the planning stage of a project
Answers: 2
You know the right answer?
Write and test a program to sum and modify a list of numbers. The program will have two functions: s...
Questions
question
Mathematics, 16.10.2020 08:01
question
Mathematics, 16.10.2020 08:01
question
Mathematics, 16.10.2020 08:01
Questions on the website: 13722361