[Tutor] (no subject)

Alan Gauld alan.gauld at yahoo.co.uk
Sun Oct 18 15:25:27 EDT 2020


On 18/10/2020 18:42, Sibylle Koczian wrote:
> Am 18.10.2020 um 13:34 schrieb Alan Gauld via Tutor:
>> On 18/10/2020 08:58, Aliyan Navaid wrote:
>>>     I want to write a program which list ALL the errors while entering a user
>>>     name.

> Exception: if two conditions can't both be true, but can both be false, 
> as the two first conditions here. In this case I'd leave the elif in.

That complicates things with two different styles.
If the OP wants to be sure ALL errors are printed simple
ifs are more reliable.

But of course you can get all sorts of complexity where
two conditions are bnoth required and only having one
is an error. Then you need compound tests etc.
Here be dragons!

Let the programmer beware!

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