If I understand what you're getting at changing '==' to 'and' will make it work the way you're expecting. Both have to evaluate to 'True' in the if statement and passing 'False' to expect_odd will always print 'error'.
"(x in odds) == expect_odd" gives the intended behaviour and I think is easier to read as well.