Write a program to input n numbers from the user. Store these numbers in a tuple. Print the maximum

Опубликовано: 16 Октябрь 2024
на канале: Portal Express
1,073
22

in this video u will learn how to input
n number in python from the user
and store to a tuple
#python

Website Link :-
https://www.pathwalla.com/2020/10/wri...

Q. 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.

Answer =

tup= ()

while True :
num = int(input("Enter a number :- "))
tup += (num,)
user = input("Do you want to quit enter yes =")
if user == "yes":
print(tup)
print("Max :-",max( tup ))
print("Min :-",min( tup ))
break