A simple solution is to check if the number is even or not. For that, you can use the % sign, which is just like division and it will calculate the remainder, so if the number divided by 2 has a remainder of 0.
if num % 2 == 0:
pass # Even
else:
pass # Odd
Or you can also use this:
if num % 2:
pass # Odd
else:
pass # Even
Looking for a Python Tutorial? Join the Intellipaat's Python Course to gain more knowledge on Python.