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, 21.06.2019 22:00
Draw the hierarchy chart and design the logic for a program that calculates service charges for hazel's housecleaning service. the program contains housekeeping, detail loop, and end-of-job modules. the main program declares any needed global variables and constants and calls the other modules. the housekeeping module displays a prompt for and accepts a customer's last name. while the user does not enter for the name, the detail loop accepts the number of bathrooms and the number of other rooms to be cleaned. the service charge is computed as $40 plus $15 for each bathroom and $10 for each of the other rooms. the detail loop also displays the service charge and then prompts the user for the next customer's name. the end-of-job module, which executes after the user enters the sentinel value for the name, displays a message that indicates the program is complete.
Answers: 2
question
Computers and Technology, 22.06.2019 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
Complete the sentence based on your knowledge of the professional difficulties faced by music artists. digital technology allows audiences to see free live telecasts of music or dance performances through
Answers: 1
question
Computers and Technology, 22.06.2019 16:20
Consider the following statements, then select one of the answers below: the signal() function shown below registers "sig_handler()" as the signal handler function for the sigkill signal, without the complexity of using when the sigkill signal is sent to a process running this code, by a user typing "kill -kill ", where the correct process id is used for to target the process, sig_handler() will be executed.
Answers: 1
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, 03.02.2021 18:20
question
Mathematics, 03.02.2021 18:20
question
Mathematics, 03.02.2021 18:20
question
Mathematics, 03.02.2021 18:20
Questions on the website: 13722363