Login Register






VERY first python program filter_list
Author
Message
RE: VERY first python program #5
(11-27-2012, 05:18 PM)LightX Wrote: The code did work, but so what you are saying is that I should use elif instead of if's the whole time?

No, I didn't say that.
I tried to explain that your current checks (if-statements) are inefficient, because you check unnecessarily.
Get to know how if, else and elif work together in order to achieve a better code.
Try to understand by looking at my explanations and pseudocode why it is better.

Maybe I can make up some examples to explain it better. I often feel that my english is not good enough.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply





Messages In This Thread
VERY first python program - by LightX - 11-26-2012, 07:59 AM