Question: In Python: The 44 lines of the file PresStates.txt contain the names of the states that produced each of the first 44 presidents. The first
In Python:
The 44 lines of the file PresStates.txt contain the names of the states that produced each of the first 44 presidents. The first four lines of the file contain the states Virginia, Massachusetts, Virginia, and Virginia. Write a program that deletes all duplications from the file and also displays the number of states that have produced presidents.
PresStates.txt is as follows:
Virginia Massachusetts Virginia Virginia Virginia Massachusetts Tennessee New York Ohio Virginia Tennessee Lousiana New York New Hampshire Pennsylvannia Illinois Tennessee Illinois Ohio Ohio New York New York Indiana New York Ohio New York Ohio New Jersey Ohio Massachusetts California New York Missouri Kansas Massachusetts Texas California Michigan Georgia California Texas Arkansas Texas Illinois
Outcome:

18 different states have produced presidents of the United States
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
