Say i've got two list and wanna make a dict of them; the first one will become keys and the second one will be values:
a = ['a', 'b', 'c']
b = ['foo', 'bar', 'baz']
dict = { 'a':'foo', 'b':'bar', 'c': 'baz' }
How to accomplish this in Viml scripting language? is there any function like zip() in python to achieve this?
You'll have to implement this kind of zip function yourself with a manual loop I'm afraid.
For instance:
Note that it can also be done without a manual loop thanks to
map()+extend(). It should be slightly faster on big lists.