A certainl part of an if() structure never gets executed.

Rick Johnson rantingrickjohnson at gmail.com
Tue Jun 11 21:46:36 EDT 2013


On Tuesday, June 11, 2013 8:25:30 PM UTC-5, nagia.... at gmail.com wrote:

> is there a shorter and more clear way to write this?
> i didnt understood what Rick trie to told me.

My example included verbatim copies of interactive sessions within the Python command line. You might understand them better if you open the Python command line and type each command in one-by-one. Here is an algoritm that explains the process:

open_command_window()
whilst learning or debugging:
    type_command()
    press_enter()
    observe_output()
    if self.badder.is_full:
        take_potty_break()
close_command_window()

Utilizing the power of interactive sessions, for learning and debugging, should be a cornerstone fundamental of your programming "work-flow" when writing code in an interpreted language like Python. 



More information about the Python-list mailing list