[Tutor] __getitem__ another problem

2016-11-23 Thread monik...@netzero.net
Hi: Can you please explain what is going on below? I do not understand how numbermap.__getitem__ brings back month's key. Does numbermap.__getitem__ bring back numbermap key or value? If key then it is not consistent with my understanding of problem in my previous email. So month is sorted by n

Re: [Tutor] __getitem__ another problem

2016-11-23 Thread Alan Gauld via Tutor
On 23/11/16 06:26, monik...@netzero.net wrote: > I do not understand how numbermap.__getitem__ brings back month's key. numbermap returns the integer corresponding to the key. That number is then used by sorted as the basis for sorting month. So for the first entry sorted receives the value 1, fo

Re: [Tutor] __getitem__ another problem

2016-11-23 Thread monik...@netzero.net
: Re: [Tutor] __getitem__ another problem Date: Wed, 23 Nov 2016 10:09:46 + On 23/11/16 06:26, monik...@netzero.net wrote: > I do not understand how numbermap.__getitem__ brings back month's key. numbermap returns the integer corresponding to the key. That number is then used by sorte

Re: [Tutor] __getitem__ another problem

2016-11-23 Thread Alan Gauld via Tutor
On 23/11/16 12:33, monik...@netzero.net wrote: > So numbermap.__getitem__ brings back 1, then 2,then 3, then 4. > Then it looks up 1 ,2, 3, 4 in month but there is no key with value 1, 2, or > or in 4. > What am I missing? Your problem is not with getitem but with sorted. You need to read up o