According to the assigned reading, biblical salvation is com…

Questions

Accоrding tо the аssigned reаding, biblicаl salvatiоn is comprehensive in scope and restorative in nature.

Yоur quiz ID is: DY73 Write thаt in the "Quiz ID" spаce оn yоur sheet.

Yоur quiz ID is: PSN9 Write thаt in the "Quiz ID" spаce оn yоur sheet.

Yоu wоrk fоr а nаtionаl weather service that wants to automate the process of reporting temperatures across cities. Your task is to write a small program that reads a list of city names from a file, generates a random temperature for each city, and writes a report classifying each city's temperature. The program will: read city names from a text file (you can assume the input cities.txt file is not erroneous) generate a random temperature (in Fahrenheit) between -20 and 110 for each city use a function to determine the temperature classification for a given temperature write a report.txt back to disk with each city's name, temperature, and classification your read and write functions must both handle file IO exceptions using try/except AND ensure the file connection is properly closed — either via a finally block or the with statement. print a histogram to the console showing how many cities fall into each temperature classification Use only the features we've covered in this course: from the first 7 chapters (feel free to use type annotations on your function definitions if you wish). Functions to be coded: Don't try to do all these at once — get read_cities working first and print the results in main, then move on. 1. read_cities — takes a filename string and returns a list of strings; connect to the file, read each city name line by line, remove whitespace/newlines from each name, and return the list. Remember: your function must handle file IO exceptions using try/except AND ensure the file connection is properly closed via a finally block or with statement. 2. generate_temperatures — takes a list of city names and returns a list of integers; for each city in the list, generate a random integer between -20 and 110 (inclusive) and append it to a new list. Return the list of temperatures. The returned list should be the same length as the cities list so that each city lines up with a temperature by position. 3. get_classification — takes a temperature (integer) and returns a string classification according to the following scale: 85 and above → "Hot"70 and above → "Warm"50 and above → "Mild"32 and above → "Cold"below 32 → "Freezing" 4. write_report — takes an output filename string, a list of city names, and a list of temperatures, and returns nothing; open the output file for writing, then iterate over each city using their index position to access both the city name and the corresponding temperature from the two lists. Call get_classification() to determine the classification and write a line in the following format: Phoenix: 97 - Hot 5. print_histogram — takes a list of temperatures and returns nothing; count how many cities fall into each classification by calling get_classification() on each temperature and tallying the results. Then print a labeled histogram to the console where each classification is displayed with a row of stars (*) representing its count. The output should be formatted so that all labels and bars are neatly aligned — note that alignment will be graded. For example: Temperature Classification Histogram========================================Hot       | *** (3)Warm      | **** (4)Mild      | *** (3)Cold      | ** (2)Freezing  | *** (3)======================================== Don't forget to add a newline after each line using + "n". Remember: your function must handle file IO exceptions using try/except AND ensure the file connection is properly closed via a finally block or with statement. Here's an outline/pseudocode for main: main:    call read_cities("cities.txt") and save the result into a variable    call generate_temperatures(), passing the list of cities, and save the result into a variable    call write_report("report.txt", list of cities, list of temperatures)    call print_histogram(), passing the list of temperatures You should then see a report.txt file appear. Note that since temperatures are randomly generated, your output will differ from the example below — what matters is that the format is correct and the classifications match the temperatures according to the scale above. Phoenix: 97 - HotSeattle: 45 - ColdMiami: 88 - HotDenver: 31 - FreezingChicago: 72 - WarmNew York: 55 - MildLos Angeles: 91 - HotHouston: 68 - MildBoston: 29 - FreezingAtlanta: 76 - WarmMinneapolis: 15 - FreezingSan Diego: 74 - WarmDallas: 95 - HotPortland: 52 - MildNashville: 83 - Warm NOTES This is just here in case your cities.txt gets overwritten accidentally during development OR the environment you are taking the test in does not permit.txt files — you can make the read_cities() function just return these city names in a list: PhoenixSeattleMiamiDenverChicagoNew YorkLos AngelesHoustonBostonAtlantaMinneapolisSan DiegoDallasPortlandNashville