Eval of expr with 'or' and 'and' within

N

Nick the Gr33k

That happens only by chance: it seems you now understand the evaluation
of "boolean" expressions in Python, so the following should be clear to
you:

yes indeed!

if we had questioned python for: "k" in (name and year and month)

that would have returned the argument month back which is "efgh" and
then the if would have evaled to false since 'k' isn't part of the latter.

"k" in (name and month and year) != "k" in (name and year and month)

As wee see, the order of the arguments in an expression matters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,797
Messages
2,569,646
Members
45,374
Latest member
VernitaBer

Latest Threads

Top