Question: I need help with this PYTHON program. Stage 1: 1. Add the following city to the array initialized as citiesInMichigan[Dearborn]: a. Change the appropriate values
I need help with this PYTHON program.
Stage 1:
1. Add the following city to the array initialized as citiesInMichigan[Dearborn]: a. Change the appropriate values to accommodate the array size change. b. Use a constant to test the while loop initialized in Declarations. 2. Add an outer loop to test for XXX entered for city to end the program. 3. Initialize a second array to hold the found values (append to the array found[] after each time FOUND_IT is set to Y). a. Then print out the array called found[] at the end of the program in a separate loop with an if statement to print Cities found first time through the loop. b. Hint: Use the len(found) to check the loop end. 4. The output should be like below using the following cities for input: Chicago Acme Brooklyn Dearborn Oklahoma City
The output must match the following:

I am given a base code to start with:
# Initialized list of cities citiesInMichigan = ["Acme", "Albion", "Detroit", "Watervliet", "Coloma", "Saginaw", "Richland", "Glenn", "Midland", "Brooklyn"]
# Get user input inCity = input("Enter name of city: ")
# Write your test statement here to see if there is a match. found_it="N" sub=0 while sub
Stage 2:
Note that this one is based on Stage 1 final code, please send both codes separetely.
1. Change the input and create a text file with the input cities. So your input statements will change to open and read the input cities(cities.txt) (Same output). 2. But the output should have a Heading printed first that says Cities of Michigan from Input File.
Thank you very much.
Enter name of city: Chicago Not a city in Michigan Enter name of city or Xxx to end: Acme City found. Enter name of city or XXX to end: Brooklyn City found. Enter name of city or Xxx to end: Dearborn City found. Enter name of city or XXX to end: Oklahoma City Not a city in Michigan Enter name of city or Xxx to end: Xxx Cities found Acme Brooklyn Dearborn
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
