Menu

[Solved]-Python Write Program Read Total Rainfall 12 Months List Program Calculate Display Total Ra Q37294486

For python: Write a program that read the total rainfall foreach of the 12 months into a list. The program should calculate anddisplay the total rainfall for the year, the average monthlyrainfall, and the months with the highest and lowest amounts. Theinput data is available in Program9.txt. No input, processing, oroutput should happen in the main function. All work should bedelegated to other functions. The program should have at least 5functions (main and developerInfo included). Include therecommended minimum documentation for each function.See the programtemplate for more details.

list of numbers for months: 1.89 1.99 2.14 2.51 5.03 3.81 1.972.31 2.91 3.97 2.68 2.44

template to follow: def main():

inFile = open(‘program9.txt’, ‘r’)
  
lineRead = inFile.readline() # Read first record
while lineRead != ”: # While there are more records
words = lineRead.split() # Split the records into substrings
annualRainfall = float(words[0])
print(format(annualRainfall, ‘.2f’))

lineRead = inFile.readline() # Read next record

# Close the file.
inFile.close() # Close file
  
# Call the main function.
main()

Expert Answer


Answer to For python: Write a program that read the total rainfall for each of the 12 months into a list. The program should calcu… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *