Answers for "unzipping the value using zip() python"

0

unzipping the value using zip() python

coordinate = ['x', 'y', 'z']
value = [3, 4, 5]

result = zip(coordinate, value)
result_list = list(result)
print(result_list)

c, v =  zip(*result_list)
print('c =', c)
print('v =', v)

#Output 
[('x', 3), ('y', 4), ('z', 5)]
c = ('x', 'y', 'z')
v = (3, 4, 5)
Posted by: Guest on January-31-2022

Code answers related to "unzipping the value using zip() python"

Python Answers by Framework

Browse Popular Code Answers by Language