Q. Write a program to accept values from a user in a tuple. Add a tuple to it and display its elements one by one. Also display its maximum and minimum value.

 

Answer =

 

tup = eval(input("Enter a tuple :-"))

min = tup[0]
max = tup[0]
for i in range(len(tup)) :
    print(tup[i]+tup[i])
    if max < tup[i] :
        max = tup[i]
    if min > tup[i]:
        min = tup[i]

print(tup)
print(max)
print(min)


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post