Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Четно/Нечетно и деление на 3
- # Напишете програма, която приема цяло число и отпечатва:
- # "Четно и се дели на 3", ако се дели на 2 и на 3
- # "Четно", ако се дели само на 2
- # "Дели се на 3", ако се дели само на 3
- # "Нито четно, нито делимо на 3" – в противен случай
- num = int(input("Please enter integer: "))
- if (num % 2 == 0 and num % 3 == 0):
- print("The number is even and divisible by 3")
- elif (num % 2 == 0):
- print("The number is even")
- elif (num % 3 == 0):
- print("The number divisible by 3")
- else:
- print("The number is neither even nor divisible by 3")
Advertisement
Add Comment
Please, Sign In to add comment