I am struggling with this little thingy. Suppose:
field_name = ['name', 'age', 'sex']
field_values = ['john', '24', 'M', 'jane', '26', 'F']
output something like:
{ 'name': ['john','jane'],
'age': ['24', '26'],
'sex': ['M', 'F']
}
Zipping right now:
dict_sample_fields = dict(zip(field_name, field_value))
#output
{ 'name': 'john',
'age': '24',
'sex': 'M'
}
How do I achieve a cyclic zipping on values?
I can achieve this long way having multi-loops. One-liner would be cool :D.