Created
September 22, 2019 11:54
-
-
Save goyalrohit/09b79ec081302774ff8f75e8632b831f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#assign employee Id to list1 | |
empId = ['1', '2', '3', '4'] | |
#assign employee name to list2 | |
empName = ['Tom', 'Maddy', 'Sam', 'John'] | |
#assign employee age to list3 | |
empAge = ['29', '30', '28', '32'] | |
#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