Question: PYTHON ONLY! PLEASE FOLLOW FORMAT! PLEASE HELP! Write a program min_max.py that reads in floats (as many as the user enters) from standard input and

PYTHON ONLY! PLEASE FOLLOW FORMAT! PLEASE HELP! Write a program min_max.py thatPYTHON ONLY! PLEASE FOLLOW FORMAT! PLEASE HELP!

Write a program min_max.py that reads in floats (as many as the user enters) from standard input and writes and the minimum and maximum values along with their ranks, ie. their positions (starting at 1) in the input. $ python min_nax.py 3.0 1.0 5.0 4.0 2.0 min val = 1.000000, min rank = 2 max val = 5.000000, max rank = 3 # min_max.py: reads in floats (as many as the user enters) from standard # input and writes out the minimum and maximum values along with their ranks, # ie, their positions (starting at 1) in the input. import studio # Smallest and largest floats. NEG_INFINITY = float('-inf') POS_INFINITY - float ('inf') # Read floats from standard input into a list a. a = ... # Define variables to keep track of the minimum value and its rank and # the maximum value and its rank. tnln_val " ... min_rank = ... max_val = ... max_rank = ... # Iterate the list a to identify the minimum value and its rank and the # maximum value and its rank. for i, v in enumerate(a): # Write the results (min_val, min_rank, max_val, max_rank)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!