[Tutor] enumerate over Dictionaries

2019-07-04 Thread Animesh Bhadra
Hi All, My python version is 3.6.7 I need help to understand this piece of code? rainbow ={"Green": "G", "Red": "R", "Blue": "B"} # ennumerate with index, and key value fori, (key, value) inenumerate(rainbow.items()): print(i, key, value) This gives a output as always:- 0 Green G 1 Red R 2 Blu

Re: [Tutor] enumerate over Dictionaries

2019-07-04 Thread Alan Gauld via Tutor
On 04/07/2019 18:02, Animesh Bhadra wrote: > Hi All, > My python version is 3.6.7 > I need help to understand this piece of code? > > rainbow ={"Green": "G", "Red": "R", "Blue": "B"} > # ennumerate with index, and key value > for i, (key, value) in enumerate(rainbow.items()): Lets unpick t from t