Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. while True:
  2. try:
  3. check = input("Input a natural number.\n->")
  4. if check == 'exit': break
  5. num = input("Input a divider.\n->")
  6. if num == 'exit': break
  7. check = int(check)
  8. num = int(num)
  9. if check % 4 == 0:
  10. print("{0} is multiple of 4.".format(check))
  11. continue
  12. elif num == 2:
  13. if check % 2 == 0:
  14. print("{0} is even.".format(check))
  15. continue
  16. elif check % 2 != 0:
  17. print("{0} is odd.".format(check))
  18. continue
  19. elif check % num == 0:
  20. print("{0} divides evenly into {1}.".format(check, num))
  21. else:
  22. print("{0} does not divide evenly into {1}.".format(check, num))
  23. except:
  24. print("Something went wrong. Please, try again.")
  25. continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement