How can I make a sentinel value NOT be initialized in a class/method - OOP?

Ian Kelly ian.g.kelly at gmail.com
Fri Jan 13 18:52:55 EST 2017


On Jan 13, 2017 3:33 PM, <daviddschool at gmail.com> wrote:


The issue I am having is that when i enter the sentinel value of QUIT, it
gets initialized as the name and printed out.  How can I get around this?
I hope this makes sense.


Hard to say for certain without seeing your code, but the most likely cause
of this is that the input string contains a trailing newline that causes it
to differ from the sentinel value you're comparing it to. Consider using
the rstrip string method to remove any trailing whitespace.


More information about the Python-list mailing list