Answer:
The program to this question can be defined as follows:
Program:
n = int(input("Enter the number: ")) #input value from user end
print("Entered value: ",n) #print value
lt = [] #defining an empty list
for i in range(n): # loop to input values
lt.append(int(input())) #add values in the list
minimum_value = min(lt) # finding minimum value
print("Smallest value: ",minimum_value) #print value
print("Normalising data: ") #print message
for x in lt: #defining loop normalising value
print(x-minimum_value) #print normalised values
Output:
Enter the number: 5
Entered value: 5
90
60
30
80
70
Smallest value: 30
Normalising data:
60
30
0
50
40
Step-by-step explanation:
In the given code a variable "n" is defined, that input value from the user end, in the next step, an empty list is defined, an two for loop is declared, which calculates the given value.
- In the first for loop, the append method is used, that input values in the given list, and at the last use the min function, that prints the smallest value in the list, and stores its value in the "minimum_value".
- In the second for loop, the "minimum_value" variable value is subtracted from the list value and print its values.