Advertisement
Guest User

code

a guest
Aug 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1.  
  2. name = input("Enter your name: ")
  3. bottom_num = float(input("Enter your age: "))
  4. month = input("Enter month of birth: ")
  5.  
  6. age1 = 5
  7. age2 = 10
  8. age3 = 20
  9. age4 = 30
  10.  
  11.  
  12. def agef(bottom_num):
  13. if bottom_num <= 10:
  14. return 5
  15. elif bottom_num <= 20:
  16. return 10
  17. elif bottom_num <= 30:
  18. return 20
  19. elif bottom_num > 30:
  20. return 30
  21.  
  22.  
  23. months = ("December", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October","November")
  24.  
  25.  
  26. def seasonf(month):
  27. if month == months[0] or month == months[1] or month == months[2]:
  28. return "winter"
  29. elif month == months[3] or month == months[4] or month == months[5]:
  30. return "spring"
  31. elif month == months[6] or month == months[7] or month == months[8]:
  32. return "summer"
  33. elif month == months[9] or month == months[10] or month == months[11]:
  34. return "fall"
  35.  
  36.  
  37.  
  38. season = str(seasonf(month))
  39. age = str(agef(bottom_num))
  40.  
  41. print("Your name is " + name + ", you are over " + age + " years old and were born in the " + season + ".")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement