22 Program to create a tuple and find the minimum and maximum number from it using Python

Program:

t = tuple()

t = [int(x) for x in input("Enter any 5 value:").split() ]



minimum = t[0]

maximum = t[0]



for i in t:

    if i >= maximum:

        maximum=i

    if i <= minimum:

        minimum=i



print("Minimum:",minimum)

print("Maximum:",maximum)


Output:




Previous
Next Post »