if message in ("0", "3", "5", "7"): ... elif message in ...
will be one way.
If message always one character long, you can also use
if message in "0357": ....
But this is also true if message == "35" , therefore a warning.
(EDIT)
A brief explanation of why your approach did not work:
if message == '0' or '3' or '5' or '7':
interpreted as
if (message == '0') or '3' or '5' or '7':
and therefore always succeeds because '3' evaluates to True .
source share