How to check Even and Odd numbers in Python 📢📣

preview_player
Показать описание

Комментарии
Автор

#Or do
number = int(input("Enter num: "))

if bin(number)[-1] == "0":
print(number, "is even")
else:
print(number, "is odd")
#this does work, if you understand base-2 you will understand how this works

GHatMakr
welcome to shbcf.ru