1.

Write a program that finds the sum of all the numbers in a Tuples using while loop?

Answer»

tuple = (1, 5, 12)

s = 0

i = 0

while(i < len (tuple)):

s = s + tuple[i]

i+ = 1

print(“Sum of elements in tuple is “ , s)

Output:

Sum of elements in tuple is 18



Discussion

No Comment Found