dict = {} string="1234" for i,ch in enumerate(string): dict[i] = ch print dict for key in dict: print key, '=', dict[key]