Program to create a tuple with 2 lists of data

In this python tuple program, we will create a tuple with 2 lists.

Steps to solve the program
  1. Take two lists as input.
  2. Combine elements having the same index no using zip() and convert that list into a tuple using tuple().
  3. Print the output.
				
					list1 = [4, 6, 8]
list2 = [7, 1, 4]
tup =tuple(zip(list1,list2))
print(tup)
				
			

Output :

				
					((4, 7), (6, 1), (8, 4))
				
			

find the maximum value from a tuple.

1 thought on “Program to create a tuple with 2 lists of data”

Leave a Comment