Stupid question, just need a quick and dirty fix

Chris Angelico rosuav at gmail.com
Fri Jul 22 00:28:37 EDT 2016


On Fri, Jul 22, 2016 at 2:19 PM, Jordan Bayless <jmbayless at gmail.com> wrote:
> I get various errors no matter what I do to this to try and make it work. Variable not defined. Referenced before assignment. etc etc. I'm lost. How do I make it work?

It might be easier if you post all your code. To be honest, what I'd
be looking at is something like this:

good_ids = {
    12, 15, 24,
    ...  # fill in all of these
}
desired = id < 10 or id > 133 or id in good_ids

But it's possible your problem has nothing to do with your massive
'if' tree and everything to do with indentation or other problems we
can't see.

ChrisA



More information about the Python-list mailing list