In: Computer Science
Write a program that asks the user to enter 3 grades and computes the minimum and the maximum of those 3 grades and prints it. Hint: Use the Math.min() and Math.max() methods. This program will compute the smallest and highest of 3 grades entered by the user.
Enter 3 grades separated by a space: 100 85.3 90.5
Smallest: 85.3
Highest: 100.0
Bye
# taking input from the user
grades = input("Enter 3 grades seperated by a space: ")
# list to store the grade entered by the user
grade = []
# spliting the value of grades variable into each grade and storing
in grade variable
for i in grades.split(" "):
grade.append(float(i))
# printing the smallest value
print("Smallest: " + str(min(grade)))
# printing the largest value
print("Highest: " + str(max(grade)))
print("Bye")