Question: rite a complete Python program to solve the Greatest Temperature Difference Problem. open that Input to this program are numbers read from the file leconte.dat.

rite a complete Python program to solve the "Greatest Temperature Difference Problem". open" that Input to this program are numbers read from the file "leconte.dat". (Yes, you Yes, you have to " e. Don't forget to "close" it afterwards.) This input consists of a sequence of real number pairs (with one decimal place) representing temperatures taken on Mount LeConte in the morning and afternoon. (Use morning and afternoon as your variable names.) To simplify reading these values, the morning value is on a line by itself followed by a second line that holds the afternoon value. So if there were, say, 100 pairs of numbers to be processed, the input file would be exactly 200 lines long. The end of input is marked by the sentinel pair "0.0 0.0" (that is, zero zero); of course, per the description above, each zero would be on a line by itself. Your program must input these pairs and determine which pair represents the greatest change in temperature. (In the event there is no input other than the sentinel pair, set the biggest change value to zero.) Print the biggest temperature change. The ONLY thing your program needs to print is this greatest temperature difference. Use the usual convention of having a main) routine that you then invoke; do NOT write any other user- defined functions. To minimize your writing, you do not have to code any comments. Note: The morning is not always colder than the afternoon. Thus you might read in the pair 50.0 65.5", which has an absolute difference of 15.5, or you could read in "65.5 50.0", which has the same absolute difference. Don't forget the numbers can be negative too. (It gets cold up on that mountain!) For example, the pair "-5.0 7.4" (with a difference of 12.4) is legal input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
