Advertisement
bounslay

Untitled

May 21st, 2023
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.43 KB | None | 0 0
  1. # March
  2. # February
  3. # April
  4.  
  5.  
  6. expected_blossom_date = input().split()
  7. average_temp_pred = int(input())
  8. rain = int(input())
  9. winter_length = int(input())
  10.  
  11.  
  12. for i in range(len(expected_blossom_date)):
  13.     if expected_blossom_date[0]:
  14.  
  15.         day = expected_blossom_date[0]
  16.        
  17.     if expected_blossom_date[1]:
  18.         full_month_name = expected_blossom_date[1]
  19.      
  20.     if expected_blossom_date[2]:
  21.         year = expected_blossom_date[2]
  22.  
  23.  
  24. day = int(day)
  25. full_month_name = str(full_month_name)
  26. year = int(year)
  27.  
  28. if year % 4 == 0:
  29.     average_temp_pred += 5
  30.  
  31.  
  32. if full_month_name == 'March' or full_month_name == 'April' or full_month_name == 'February':
  33.     winter_length /= 7
  34.     day += winter_length
  35.  
  36.     if average_temp_pred > 20:
  37.         remaining_degrees = average_temp_pred - 20
  38.         day -= remaining_degrees
  39.    
  40.     elif average_temp_pred < 20:
  41.         remaining_degrees = 20 - average_temp_pred
  42.         day += remaining_degrees
  43.    
  44.     if rain > 30 or rain < 30 and rain % 3 == 0:
  45.         remaining_cm = abs(rain - 30)
  46.  
  47.         while remaining_cm > 0 and remaining_cm % 3 == 0:
  48.             remaining_cm /= 3
  49.             day += 1
  50.    
  51.  
  52.     if day < 0 and year % 4 == 0:
  53.         day *= -1
  54.         day = 29 - day
  55.         full_month_name = 'February'
  56.  
  57.     elif day < 0:
  58.         day *= -1
  59.         day = 28 - day
  60.         full_month_name = 'February'
  61.  
  62.  
  63. print(f"{day:.0f} {full_month_name} {year}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement