Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while True:
- try:
- check = input("Input a natural number.\n->")
- if check == 'exit': break
- num = input("Input a divider.\n->")
- if num == 'exit': break
- check = int(check)
- num = int(num)
- if check % 4 == 0:
- print("{0} is multiple of 4.".format(check))
- continue
- elif num == 2:
- if check % 2 == 0:
- print("{0} is even.".format(check))
- continue
- elif check % 2 != 0:
- print("{0} is odd.".format(check))
- continue
- elif check % num == 0:
- print("{0} divides evenly into {1}.".format(check, num))
- else:
- print("{0} does not divide evenly into {1}.".format(check, num))
- except:
- print("Something went wrong. Please, try again.")
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement