Python tuple program to add a list in the tuple

In this python tuple program, we will add a list in the tuple.

Steps to solve the program
  1. Create a list and a tuple.
  2. Convert the tuple into a list using list() and add another list to it using+ “.
  3. Now convert the combined list to a tuple using tuple().
  4. Print the output.
				
					list1 = [12,67]
tup = (6,8,4)
result = tuple(list(tup) + list1)
print(result)
				
			

Output :

				
					(6, 8, 4, 12, 67)
				
			

check whether an element exists in a tuple or not.

find sum of elements in a tuple.

1 thought on “Python tuple program to add a list in the tuple”

Leave a Comment