In this python tuple program, we will add a list in the tuple.
Steps to solve the program
- Create a list and a tuple.
- Convert the tuple into a list using list() and add another list to it using ” + “.
- Now convert the combined list to a tuple using tuple().
- Print the output.
list1 = [12,67]
tup = (6,8,4)
result = tuple(list(tup) + list1)
print(result)
Output :
(6, 8, 4, 12, 67)
1 thought on “Python tuple program to add a list in the tuple”