4
Question Question 3
Write a program to input n numbers from the user. Store these numbers in a tuple. Print the maximum and minimum number from this tuple.
Solution
n = eval(input("Enter the numbers: "))
tup = tuple(n)
print("Tuple is:", tup)
print("Highest value in the tuple is:", max(tup))
print("Lowest value in the tuple is:", min(tup))Output
Enter the numbers: 3,1,6,7,5
Tuple is: (3, 1, 6, 7, 5)
Highest value in the tuple is: 7
Lowest value in the tuple is: 1