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

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 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