Skip to content

Instantly share code, notes, and snippets.

@goyalrohit
Created September 22, 2019 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goyalrohit/208de142b45d1fd84a2018bc4527be4a to your computer and use it in GitHub Desktop.
Save goyalrohit/208de142b45d1fd84a2018bc4527be4a to your computer and use it in GitHub Desktop.
#!/usr/bin/python
#assign employee Id to list1 of size 5
empId = ['1', '2', '3', '4', '5']
#assign employee name to list2 of size 4
empName = ['Tom', 'Maddy', 'Sam', 'John']
#assign employee age to list3 of size 6
empAge = [29, 30, 28, 32 ,33 , 34]
#zip the values
emp = zip(empId, empName , empAge)
empList = list(emp)
#unzip and extract the data
a, b, c = zip( *empList )
print('Employee Id ', list(a));
print('Employee Name ', list(b));
print('Employee Age ', list(c));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment