I need help with this homework, description below: Ask user for a file with integer numbers (one number in a row). If the file does not exist, print a message and finish. Make an empty list. Read each...



























I need help with this homework, description below:
Ask user for a file with integer numbers (one number in a row). If the file does not exist, print a message and finish.
Make an empty list. Read each row, delete the new line character (method strip()), convert it to integer and append into the list. If the row does not contain an integer, skip it and continue with next.
Print the greatest number or a message for an empty list.
Write all the numbers and their difference from the greatest number to a new .csv file in form
number; difference.
Example
Input file:
87
-18
-100
-55
15
-2
-88
90
11
21
73
-14
-38
Output file:
87;3
-18;108
-100;190
-55;145
15;75
-2;92
-88;178
90;0
11;79
21;69
73;17
-14;104
-38;128













Apr 14, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here