I’m trying to create a dictionary from elements in a list. The list elements are read from a text file. The dictionary created has unordered key value pairs. I’m working on python 2.6.4 on redhat linux .
ll = ['modu1', 'path1', 'modu2', 'path2', 'modu3', 'path3']
it = iter(ll)
Lt = zip(it,it)
Op = dict(Lt)
expected Op should be {'modu1:path1 ,modu2:path2, modu3:path3} but i’m getting Op as { modu2:path2, modu3:path3, modu1:path1}