Created
November 22, 2017 09:23
-
-
Save azdafirmansyah/441537cdeaea4fe541118935a66ecc5a to your computer and use it in GitHub Desktop.
Challange - Odd Or Even
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Ask the user for a number. Depending on whether the number is even or odd, print out an appropriate message to the user. | |
#If the number is a multiple of 4, print out a different message. | |
#Ask the user for two numbers: one number to check (call it num) and one number to divide by (check). If check divides evenly into num, tell that to the user. If not, print a different appropriate message. | |
while True: | |
try: | |
num = int(input("Please input number : ")) | |
check = int(input("Please input divide number :")) | |
if num % 4 == 0: | |
print("Your number multiply 4 :",num) | |
if num % 2 == 0: | |
print("Your input Even Number : ",num) | |
else: | |
print("Your input Odd Number : ",num) | |
if num % check == 0: | |
print("Divide event") | |
else: | |
print("Not divide event") | |
except Exception as error: | |
print("Please enter numeric : ", error) | |
finally: | |
print("-----------------------") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment