I want to map two tuples into a new list in python. One To One relation between that two tuples and then convert that into list.
tup_1 = (1, 2, 3)
tup_2 = (4, 5, 6)
x = map(tup_1, tup_2)
>>> x
[(1, 4), (2, 5), (3, 6)]
I want to map two tuples into a new list in python. One To One relation between that two tuples and then convert that into list.
tup_1 = (1, 2, 3)
tup_2 = (4, 5, 6)
x = map(tup_1, tup_2)
>>> x
[(1, 4), (2, 5), (3, 6)]
I want to map two tuples into a new list in python.
It is very easy in python, just use zip function of python, that will give you an iterative object. Convert that object into list using list function of python.
tup_1 = (1, 2, 3)
tup_2 = (4, 5, 6)
x = list(zip(tup_1, tup_2))
>>> x
[(1, 4), (2, 5), (3, 6)]