Answered step by step
Verified Expert Solution
Link Copied!

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.
image text in transcribed
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

Distinguish between cholinergic and adrenergic nerve fibers.

Answered: 1 week ago

Question

2. How can speakers enhance their credibility?

Answered: 1 week ago