Guest User

Untitled

a guest
Feb 25th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import datetime
  2.  
  3. print("Write the month in number form! Thank You. Example, When May, type 5. ")
  4. b = int(input("What year are you born in? "))
  5.  
  6.  
  7. now = datetime.datetime.now()
  8. current = now.year
  9. currentM = now.month
  10. while b:
  11. if b > current:
  12. print("Stop Lying!")
  13. b = int(input("What year are you born in? "))
  14. elif b == current:
  15. m = int(input("What month are you born in? "))
  16. if m > currentM:
  17. print("Stop Lying!")
  18. m = int(input("What month are you born in? "))
  19. else:
  20. print("You are " + str(current-b) + " years old")
  21. break
  22. else:
  23. m = int(input("What month are you born in? "))
  24. if m > currentM:
  25. print("You are " + str(current-b-1) + " years old")
  26. else:
  27. print("You are " + str(current-b) + " years old")
  28. break
Add Comment
Please, Sign In to add comment