On 29/05/17 00:12, Alex Kleider wrote:
> On 2017-05-28 13:13, Mats Wichmann wrote:
>
>> FWIW, if checking for multiples, you could also write:
>>
>> if Month in ['January', '1']:
>
> Would
>
>>>> if Month in {'January', '1'}:
>
> be even better? (regarding efficiency perhaps? Trivial point, I know,
> but just wondering.)
If in doubt try it out and profile/time it.
But I don't think it will make much difference since ultimately
it still has to test each value (although a hashing algorithm
may be involved that works on partial matches...) But if in
doubt...
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor