[Tutor] Python help

Alan Gauld alan.gauld at btinternet.com
Mon Apr 2 20:41:53 EDT 2018


On 03/04/18 01:19, Steven D'Aprano wrote:
>
>>     if Grade not in 'A','B','C','D','E','F':
> Actually, that returns a tuple consisting of a flag plus five more 
> strings:
>
> py> 'A' in 'A','B','C', 'D', 'E', 'F'
> (True, 'B','C', 'D', 'E', 'F')

Although in the context of the program the colon at the end ensures
we get a syntax error so the mistake is found pretty quickly...

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



More information about the Tutor mailing list