You can use the zip () function:
for zipped in zip(arr1.split(",") , arr2.split(",")): someDictionary[zipped[0]] = zipped[1]
zip() creates a tuple for each pair of items in collections, then you map to each other. If your "arrays" have different lengths, you can use map() :
a = [1,3,4] b = [3,4] print map(None, a, b) [(1, 3), (3, 4), (4, None)]
source share