Sep 14, 2018

in operator in Python

if m in [1,3,5,7]:

instead:

if m==1 or m==3 or m==5 or m==7:

Or, for the in operator we can also use ' {1, 3, 5, 7} ' instead of ' [1, 3, 5, 7] ' because the element in set is an O (1) operation.