Mega Code Archive

 
Categories / Python Tutorial / Buildin Function
 

Uses a dictionary as the sequence to display the dictionary contents

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