Focus on Basic file operations, exception handling. Save a copy of the file module6data.txt (Below) Write a program that will Open the file module6data.txt Create a second file named processed. txt Read the numbers from the first file one at a time. For each number write into second file, if possible, its Square Square root iii. Reciprocal (1/number)use a math module function for the square root. use exception handling to trap possible errors. Report the number of items in the original file and the number that were successfully stored in the second file. Report the number of each type of error: ValueError, ZeroDivisionError, TypeError 26 O 76 -91 85 -44 85 -95 -34 83 -64 -76 -41 89 0 83 -99 -69 8 -79 0 -32 -49 -89 85 79 -28 56 19 -93 -21 -23 82 51 -80 l 62 -78 -8 71 28 -73 0 -45 -73 28 -5 O -70 63 -36 -72 0 -76 -24 -59 0 -54 83 35 -3 88 -14 29 -35 17 27 -61 -42 49 83 38 79 -80 33 8 41 96 -94 46 71 8 76 -63 -36 93 -82 -68 -20 69 -57 -84 -29 -17 77 36 -89 -94 62 10 -69 -43 Use meaningful variable names. Single letter variable names are forbidden except as counters in loops. Use blank lines to separate major parts of a program or function. Use spaces around all operators. For example, write x = y + 5, NOT x=y+5 Use named constants, not magic numbers. Organize your python program file. Your file should have, in this order a full header comment, as specified in the guidelines any named constants used by the program, the definition of the main() function, all functions other than main(), the call to main()at the very bottom of the file.
Focus on Basic file operations, exception handling. Save a copy of the file module6data.txt (Below) Write a program that will Open the file module6data.txt Create a second file named processed. txt Read the numbers from the first file one at a time. For each number write into second file, if possible, its Square Square root iii. Reciprocal (1/number)use a math module function for the square root. use exception handling to trap possible errors. Report the number of items in the original file and the number that were successfully stored in the second file. Report the number of each type of error: ValueError, ZeroDivisionError, TypeError 26 O 76 -91 85 -44 85 -95 -34 83 -64 -76 -41 89 0 83 -99 -69 8 -79 0 -32 -49 -89 85 79 -28 56 19 -93 -21 -23 82 51 -80 l 62 -78 -8 71 28 -73 0 -45 -73 28 -5 O -70 63 -36 -72 0 -76 -24 -59 0 -54 83 35 -3 88 -14 29 -35 17 27 -61 -42 49 83 38 79 -80 33 8 41 96 -94 46 71 8 76 -63 -36 93 -82 -68 -20 69 -57 -84 -29 -17 77 36 -89 -94 62 10 -69 -43 Use meaningful variable names. Single letter variable names are forbidden except as counters in loops. Use blank lines to separate major parts of a program or function. Use spaces around all operators. For example, write x = y + 5, NOT x=y+5 Use named constants, not magic numbers. Organize your python program file. Your file should have, in this order a full header comment, as specified in the guidelines any named constants used by the program, the definition of the main() function, all functions other than main(), the call to main()at the very bottom of the file.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Focus on Basic file operations, exception handling.
Save a copy of the file module6data.txt (Below)
Write a program that will
- Open the file module6data.txt
- Create a second file named processed. txt
- Read the numbers from the first file one at a time. For each number write into second file, if possible, its
- Square
- Square root
iii. Reciprocal (1/number)use a math module function for the square root. use exception handling to trap possible errors.
- Report the number of items in the original file and the number that were successfully stored in the second file.
- Report the number of each type of error: ValueError, ZeroDivisionError, TypeError
26
O
76
-91
85
-44
85
-95
-34
83
-64
-76
-41
89
0
83
-99
-69
8
-79
0
-32
-49
-89
85
79
-28
56
19
-93
-21
-23
82
51
-80
l
62
-78
-8
71
28
-73
0
-45
-73
28
-5
O
-70
63
-36
-72
0
-76
-24
-59
0
-54
83
35
-3
88
-14
29
-35
17
27
-61
-42
49
83
38
79
-80
33
8
41
96
-94
46
71
8
76
-63
-36
93
-82
-68
-20
69
-57
-84
-29
-17
77
36
-89
-94
62
10
-69
-43
- Use meaningful variable names. Single letter variable names are forbidden except as counters in loops.
- Use blank lines to separate major parts of a program or function.
- Use spaces around all operators. For example, write x = y + 5, NOT x=y+5
- Use named constants, not magic numbers.
- Organize your python program file. Your file should have, in this order
- a full header comment, as specified in the guidelines
- any named constants used by the program,
- the definition of the main() function,
- all functions other than main(),
- the call to main()at the very bottom of the file.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY