Write a Python program to input n numbers from the user at run-time. Store these
numbers in a tuple. Print the maximum and minimum number from this tuple.
Answers
Answer:
t = tuple ( )
n = input (“Enter any number”)
print “Enter all numbers one after other”
for i in range (n) :
a = input (“Enter number”)
t = t+(a, )
print “Output is”
print t
Answer:
Answer
2.0/5
8
computersengineers43
Ambitious
11 answers
513 people helped
Answer:
Explanation:
t = tuple ( )
n = input (“Enter any number”)
print “Enter all numbers one after other”
for i in range (n) :
a = input (“Enter number”)
t = t+(a, )
print “Output is”
print t
kattyahto8 and 11 more users found this answer helpful
THANKS
8
2.0
(3 votes)
Answer
1
qwtable
Ambitious
248 answers
114.2K people helped
# python program for storing n elements in a tuple
required_tuple = tuple()
number_of_element = int(input('Number of elements: '))
for i in range(number_of_element):
element = int(input('Enter number: '))
required_tuple +5= (element,)
print('stored tuple is: ', required_tuple)
1st line creates a variable of tuple type, empty, where we will store n numbers provided by user.
2ed line creates a variable of integer type, taking input from the user, which will be the required n.
3rd line is a for loop with range n to run the whole process n times, each time it takes a number as input adds it to tuple and goes all over again.
Last we print the stored tuple
Explanation: