subject

In this assignment, you will revisit reading data from a file, and use that data as arguments (parameters) for a number of functions you will write. You will need to:Write and test a function square_each(nums)Where nums is a (Python) list of numbers. It modifies the list nums by squaring each entry and replacing its original value. You must modify the parameter, return will not be allowed!Write and test a function sum_list(nums)Where nums is a (Python) list of numbers. It returns the sum of the numbers in passed-in the list. Write and test a function to_numbers(str_list)Where str_list is a list of strings, each of which represents a number. Modify each entry in the list by converting it to a number. You can choose to use return the list, or just modify str_list in-place, similar to #1, above. Write and test a function main()Take the previous three functions and construct a main() function that will call these functions properly. The program computes the sum of the squares of numbers read from a file. Your program should prompt for a file name and print out the sum of the squares of the values in the file. Hint: use readlines()You may download two example files of numbers to read in, numbers (space seperated)or numbers (comma seperated). You may choose to read in numbers in another format of your choosing, http://www. pas. rochester. edu/~rsarkis/csc161/_static/misc/nu mbers. txt, and http://www. pas. rochester. edu/~rsarkis/csc161/_static/misc/nu mbers_csv. txt so long as you choose one method and document it in your program comments. OutputThis example parses the numbers_csv. txt file. The result should be the same regardless of which input data was used. This program computes the sum of the squares of numbers read from a file. Please enter the file name: numbers_csv. txtThe sum of the squares of the numbers in the file is 32932.0

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:10
Look at the far left lane in the picture. explain what the red car is doing and what it needs to do to travel safely.
Answers: 2
question
Computers and Technology, 24.06.2019 00:30
Use the keyword strategy to remember the meaning of the following word. the meaning for the word has been provided. write your keyword and describe the picture you would create in your mind. obfuscate: to make something so confusing that it is difficult to understand.
Answers: 2
question
Computers and Technology, 24.06.2019 10:20
Multiple choice project create a program with two multiple choice questions. 1. users have two attempts only, show attempt number each time. hint: while loop with break control. (20%) 2. only one correct answer for each question, use switch case for each question. (20%) 3. show total score after the two questions are answered. hint: . (20%) 4. user have options to answer the two questions again if first attempt score is not 100%. hint: if statment. (20%) 5. use string method .toupper() to allow users to enter with lowercase or uppercase letters. (20%) 1. where is the capital of the state of florida? a. orlando b. tallahassee c. miami d. tampa b 2. where is walt disney world park located in florida? a. orlando b. tallahassee c. miami d. tampa a
Answers: 1
question
Computers and Technology, 24.06.2019 12:00
An npn transistor is correctly biased and turned on if the a. base is negative. b. collector is negative. c. collector is positive with respect to the emitter and negative with respect to the base. d. collector is the most positive lead followed by the base.
Answers: 1
You know the right answer?
In this assignment, you will revisit reading data from a file, and use that data as arguments (param...
Questions
question
Mathematics, 07.10.2020 21:01
question
Mathematics, 07.10.2020 21:01
Questions on the website: 13722361