Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Python. Write a program that reads a file of numbers of type int and writes all the numbers to another file, but without any
Using Python.
Write a program that reads a file of numbers of type int and writes all the numbers to another file, but without any duplicate numbers. Assume that the numbers in the input file are already ordered from smallest to largest. After the program is run, the new file will contain all the numbers in the original file, but no number will appear more than once in the file. The numbers in the output file should also be sorted from smallest to largest. Your program should obtain both file names from the user. The input files is a text-file with one number per line. In addition, everything written to the output file should also be written to the screen/monitor so that the user is aware of where the program is in processing. Make sure to use exception handling around all user input and file processing. Case 1: Use the input file, InputNumbers.txt Write your output to file, OutputNumbers.txt Case 2: Use the input file, Input2.txta Write your output to file, Output2.txt Your prompts should be: Input filename request: Please enter the name of your input file: Output filename request: Please enter the name of your output file: First line of output: Unique Numbers in file InputNumbers.txt are: Last line of output (after unique numbers are printed out): There were 97 unique integers in the file InputNumbers.txt that contained a total of 2216 integers Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started