Question: Part 1 : Write a Python file called p 1 . py that prints a menu that either displays the number of unique sectors in
Part :
Write a Python file called
ppy that prints a menu that either displays the number of unique
sectors in the database or exits execution.
You are provided a text file that is space delimited, called companyList.txt If the user indicates
that he would like to know the number of sectors your program should read the file then you will
read the file line by line.
Your program will accomplish the following:
Read in the file companyList.txt and store the information.
a You can do this by creating two lists.
Determine the number of unique sectors You must use a set for this part.
The user is prompted as to whether they would like a readout of the sectors or to
terminate execution.
a Display the total number of sectors and companies and a list of the sectors along
with the number of companies in each sector.
Your output should appear similar to:
Welcome to the Generic Finance App!
Enter to see how many sectors there are.
Enter any other input to quit
There are sectors companies
: FMCG
: Conglomerate
: Defense
: Auto
: Finance
: Retail
: Software
: oil
: Semiconductor
Press enter to continue...
Enter to see how many sectors there are.
Enter any other input to quit
It is Ok if the sectors are listed in a different order than shown above.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
