Write a Python program to find the maximum and minimum numbers from the specified decimal numbers


This program takes input from the user in the form of multiple decimal numbers separated by commas. The input() function is used to prompt the user to enter the numbers, which are then split into a list using the split() method and stored in the variable dec.

The max() and min() functions are then used to find the largest and smallest numbers in the list dec respectively. The max() function returns the largest number in the list, and the min() function returns the smallest number in the list.

Finally, the results are printed using the print() function. The largest and smallest numbers in the list are printed on separate lines with the strings "Maximum: " and "Minimum: " respectively, followed by the corresponding values.

Overall, this program is a simple implementation of how to find the maximum and minimum values from a list of decimal numbers separated by commas. It can be used for basic data analysis tasks in Python.

Source Code

print("Enter the Multiple Decimal Points Comma Separate...")
dec = input("").split(",")
print("Maximum: ", max(dec))
print("Minimum: ", min(dec))

Output

Enter the Multiple Decimal Points Comma Separate...
23.45,67.23,1.45,89.67,0.34
Maximum:  89.67
Minimum:  0.34

Example Programs