In this python tuple program, we will find the sum of elements in a tuple.
Steps to solve the program
- Create a tuple.
- Find the sum of elements in the tuple using sum().
- Print the output.
tup = (4,6,2)
print("Sum of elements in the tuple: ",sum(tup))
Output :
Sum of elements in the tuple: 12
add a list in the tuple.
1 thought on “Python tuple program to find the sum of elements in a tuple”