Question: Please help me with this question. The answer is given below. However, I do not understand the answer. Please explain the code step by step.

Please help me with this question.

The answer is given below.

However, I do not understand the answer.

Please explain the code step by step.

For example, I do not understand the part 'if a>maximum:'.

Because I can see a>maximum and a=maximum together so I am not sure how this works.

The question is

Write a Python program that reads a positive integer user input value n and then reads n user input float values and finally prints both the minimum and maximum among the n user input float values.

The answer is

n=int(input('Enter a positive integer for n:')) a=float(input('Enter n values :')) maximum=a minimum=a for i in range(n-1): a=float(input('Enter n values :')) if a>maximum: maximum=a if a

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!