Philip's just turned four and he wants to know how old he will be in various years in the future such as 2090 or 3044. His parents can't keep up calculating this so they've begged you to help them out by writing a programme that can answer Philip's endless questions.

Your task is to write a function that takes two parameters: the year of birth and the year to count years in relation to. As Philip is getting more curious every day he may soon want to know how many years it was until he would be born, so your function needs to work with both dates in the future and in the past.

Provide output in this format: For dates in the future: "You are ... year(s) old." For dates in the past: "You will be born in ... year(s)." If the year of birth equals the year requested return: "You were born this very year!"

"..." are to be replaced by the number, followed and proceeded by a single space. Mind that you need to account for both "year" and "years", depending on the result.

Good Luck!

Difficulty: introductory

Starter code:

def calculate_age(year_of_birth, current_year):
	

Solutions:
def calculate_age(year_of_birth, current_year):
    diff = abs(current_year - year_of_birth)
    plural = '' if diff == 1 else 's'
    if year_of_birth < current_year:
        return 'You are {} year{} old.'.format(diff, plural)
    elif year_of_birth > current_year:
        return 'You will be born in {} year{}.'.format(diff, plural)
    return 'You were born this very year!'

def calculate_age(birth, curr):
    diff = abs(curr - birth)
    age = "%d year%s" % (diff, "s" * bool(diff-1))
    return "You were born this very year!" if not diff else "You are %s old." % age if curr > birth else "You will be born in %s." % age

def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    if age == 0:
       return "You were born this very year!"
    elif age > 0:
       return "You are {} year{} old.".format(age, 's' if age > 1 else '')
    else:
       return "You will be born in {} year{}.".format(abs(age), 's' if abs(age) > 1 else '')

def calculate_age(birth_year, this_year):
    results, plural = this_year-birth_year, ''
    
    if abs(results) != 1: 
        plural = 's'
        
    if results > 0: 
        return 'You are %s year%s old.' % (results, plural)
    elif results < 0:
        return 'You will be born in %s year%s.' % (abs(results), plural)
    elif results == 0: 
        return 'You were born this very year!'

def calculate_age(birth_year, current_year):
    results, plural = current_year-birth_year, ''
    
    if abs(results) != 1:
        plural = 's'
        
    if results > 0: 
        out = 'You are %s year%s old.' % (results, plural)
    elif results == 0: 
        out = 'You were born this very year!'
    else:
        out = 'You will be born in %s year%s.' % (abs(results), plural)
    return out

def calculate_age(year_of_birth, current_year):
    year = (year_of_birth - current_year)
    c1 = f"You are {abs(year)} {['year','years'][abs(year)!=1]} old."
    c2 = f"You will be born in {year} {['year','years'][year!=1]}."
    return 'You were born this very year!' if not year else [c1,c2][year >0 ]

def calculate_age(dob, now):
    return f"You will be born in {dob-now} {'years'if dob-now>1 else 'year'}." if dob>now else "You were born this very year!" if dob==now else f"You are {now-dob} {'years'if now-dob>1 else 'year'} old."

def calculate_age(year_of_birth, current_year):
    year = current_year - year_of_birth
    if year > 1: return f'You are {year} years old.'
    if year == 1: return f'You are {year} year old.'
    if year == -1: return f'You will be born in {abs(year)} year.'
    if year < 0: return f'You will be born in {abs(year)} years.'
    else: return 'You were born this very year!'


def calculate_age(year_of_birth, current_year):
    a = abs(current_year - year_of_birth)
    if not a:
        return 'You were born this very year!'
    else:
        return (f'You are {a} year{("", "s")[a>1]} old.', f'You will be born in {a} year{("", "s")[a>1]}.')[current_year < year_of_birth]

def calculate_age(year_of_birth, current_year):
  diff = current_year - year_of_birth
  s = 's' if abs(diff) > 1 else ''
  return f'You are {diff} year{s} old.' if diff > 0 else f'You will be born in {-diff} year{s}.' if diff < 0 else 'You were born this very year!'

def calculate_age(birth, current):
    total = abs(current - birth)
    plural = 's' if total > 1 else ''
    if birth == current: return "You were born this very year!"
    return "You will be born in {} year{}.".format(total, plural) if birth > current else "You are {} year{} old.".format(total, plural)

calculate_age = lambda b,c: ["You will be born in {} year{}.", "You were born this very year!", "You are {} year{} old."][((c-b)>=0) + ((c-b)>0)].format(abs(c-b), 's' if abs(c-b)!=1 else '')

def calculate_age(yob, cy):
    return ['You will be born in %s %s.' % (yob-cy, ['years', 'year'][(yob-cy)<2]),
            'You are %s %s old.' % (cy - yob, ['years', 'year'][(cy - yob) < 2])][cy-yob>0] if (cy-yob) != 0 \
        else "You were born this very year!"

calculate_age=lambda b, y: (lambda d: "You are %s year%s old." %(d,"s" if d!=1 else "") if d>0 else "You will be born in %s year%s." %(-d,"s" if d!=-1 else "") if d<0 else "You were born this very year!")(y-b)

def calculate_age(year_of_birth: int, current_year: int) -> str:
    """ Calculate how many years it was until a person would be born based on given data. """
    age = current_year - year_of_birth
    if age > 0:
        return f"You are {age} {'year' if age == 1 else 'years'} old."
    elif age < 0:
        return f"You will be born in {abs(age)} {'year' if abs(age) == 1 else 'years'}."
    else:
        return "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    if age == 0: return "You were born this very year!"
    if age == 1: return "You are 1 year old."
    if age > 1:  return "You are " + str(age) + " years old."
    if age == -1: return "You will be born in 1 year."
    return "You will be born in " + str(abs(age)) + " years."

def calculate_age(year_of_birth, current_year):
    dif = year_of_birth-current_year
    return "You "+["are {} year{} old.", "will be born in {} year{}."][dif>0].format(abs(dif), "s"*(abs(dif)!=1)) if dif else "You were born this very year!"

def calculate_age(b, c):
    return 'You are {} {} old.'.format(c-b, 'years' if c-b > 1 else 'year') if c>b else 'You will be born in {} {}.'.format(b-c, 'years' if b-c > 1 else 'year') if b>c else 'You were born this very year!'

def calculate_age(year_of_birth, current_year):
    diff = current_year - year_of_birth
    return (f"You are {diff} year{'s' * (diff > 1)} old." if diff > 0 else 
            f"You will be born in {-diff} year{'s' * (-diff > 1)}." if diff < 0 else 
            "You were born this very year!")

def calculate_age(year_of_birth, current_year):
    r = year_of_birth - current_year

    if r == 0: return 'You were born this very year!'
    elif abs(r) > 1: year = 'years'
    else: year = 'year'

    return  f'You will be born in {r} {year}.' if r > 0 else f'You are {abs(r)} {year} old.'

def calculate_age(year_of_birth, current_year):
   age = current_year - year_of_birth
   if age > 1:
       return f"You are {age} years old."
   elif age == 1:
       return f"You are {age} year old."
   elif age < -1:
       return f"You will be born in {-age} years."
   elif age == -1:
       return f"You will be born in {-age} year."
   else:
       return "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    age =  current_year - year_of_birth
    return [
        "You are {} year{} old.".format(age,'s' if age > 1 else ''),
        "You will be born in {} year{}.".format(abs(age),'s' if abs(age) > 1 else ''),
        "You were born this very year!"
        ][0 if age > 0 else (1 if age < 0 else 2)]

def calculate_age(year_of_birth, current_year):
    if current_year - year_of_birth > 0: return 'You are %d year%s old.' %(current_year - year_of_birth, '' if current_year - year_of_birth == 1 else 's')
    elif current_year - year_of_birth < 0: return 'You will be born in %d year%s.' %(year_of_birth - current_year, '' if year_of_birth - current_year == 1 else 's')
    else: return 'You were born this very year!'

def calculate_age(year_of_birth, current_year):
    diff = current_year - year_of_birth
    if diff == 0:
        return "You were born this very year!"
    elif diff == 1:
        return "You are {} year old.".format(diff)
    elif diff > 1:
        return "You are {} years old.".format(diff)
    elif diff == -1:
        return "You will be born in {} year.".format(abs(diff))
    elif diff < -1:
        return "You will be born in {} years.".format(abs(diff))

def calculate_age(year_of_birth, current_year):
    diff = current_year - year_of_birth
    return "You are {} {} old.".format(diff,"year" if diff == 1 else "years") if diff > 0 else "You will be born in {} {}.".format(-diff,"year" if diff == -1 else "years") if diff < 0 else "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    years = abs(year_of_birth - current_year)
    if years == 1 and year_of_birth < current_year: return "You are 1 year old."
    if years == 1 and year_of_birth > current_year: return "You will be born in 1 year."
    return f"You are {years} years old." if year_of_birth < current_year else f"You will be born in {years} years." if year_of_birth > current_year else "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    s = "s" if abs(current_year-year_of_birth) > 1 else ""
    return "You were born this very year!" if year_of_birth == current_year else f"You are {current_year - year_of_birth} year{s} old." if current_year > year_of_birth else f"You will be born in {year_of_birth-current_year} year{s}."

def calculate_age(year_of_birth, current_year):
    ans = current_year - year_of_birth
    if ans == 0:
        ans = "You were born this very year!"
    elif ans == 1:
        ans = "You are 1 year old."
    elif ans < 1 and ans != -1:
        ans = "You will be born in " + str(ans * -1)  + " years."
    elif ans == -1:
        ans = "You will be born in 1 year."
    else:
        ans = "You are " + str(ans) + " years old."
    return ans

def calculate_age(year_of_birth, current_year):
    difference = current_year - year_of_birth
    if difference == 1:
        return "You are 1 year old."
    if difference == -1:
        return "You will be born in 1 year."
    if difference > 0:
        return "You are {difference} years old.".format(difference = difference)
    if difference == 0:
        return "You were born this very year!"
    else:
        difference = abs(difference)
        return "You will be born in {difference} years.".format(difference = difference)

def calculate_age(year_of_birth, current_year):
    
    age = current_year - year_of_birth
    
    if age == 0:
        return "You were born this very year!"
    
    if age > 0:
        return f"You are {age} year{'s' if age != 1 else ''} old."
    
    if age < 0:
        return f"You will be born in {-age} year{'s' if age != -1 else ''}."


def calculate_age(yob, cy):
    if cy == yob+1:
        return "You are 1 year old."
    if yob == cy+1:
        return "You will be born in 1 year."
    return "You were born this very year!" if yob == cy else f"You are {cy-yob} years old." \
            if cy>yob else f"You will be born in {yob-cy} years."

def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    if age < 0:
        return f"You will be born in {abs(age)} {'year' if age == -1 else 'years'}."
    if age == 0:
        return 'You were born this very year!'
    return f"You are {age} {'year' if age == 1 else 'years'} old."

def calculate_age(b, c):
    if c - b > 1:
        return "You are {} years old.".format(c - b)
    elif c - b == 1:
        return "You are 1 year old."
    elif c == b:
        return "You were born this very year!"
    elif b - c > 1:
        return "You will be born in {} years.".format(b - c)
    else:
        return "You will be born in 1 year."

def calculate_age(year_of_birth, current_year):
    d = current_year - year_of_birth
    if d > 0:
        if d == 1:
            return 'You are ' + str(d) + ' year old.'
        else:
            return 'You are ' + str(d) + ' years old.'
    elif d < 0:
        if d == -1:
            return 'You will be born in ' + str(-d) + ' year.'
        else:
            return 'You will be born in ' + str(-d) + ' years.'
    else:
        return 'You were born this very year!'
    
    


def calculate_age(year_of_birth, current_year):
    if year_of_birth == current_year:
        return "You were born this very year!"
    elif current_year - year_of_birth == 1:
        return "You are 1 year old."
    elif year_of_birth - current_year == 1:
        return "You will be born in 1 year."
    elif year_of_birth < current_year:
        return f"You are {current_year - year_of_birth} years old."
    else:
        return f"You will be born in {year_of_birth - current_year} years."

def calculate_age(year_of_birth, current_year):
    if current_year > year_of_birth and current_year - year_of_birth == 1:
        return 'You are 1 year old.'
    elif current_year > year_of_birth and current_year - year_of_birth != 1:
        return f'You are {current_year - year_of_birth} years old.'
    elif current_year == year_of_birth:
        return 'You were born this very year!'
    elif year_of_birth - current_year == 1:
        return 'You will be born in 1 year.'
    else: 
        return f'You will be born in {year_of_birth - current_year} years.'

def calculate_age(b, c):
    return f"You will be born in {str(b-c)+' year' if b-c<=1 else str(b-c)+' years'}." if c-b<0 else  f"You were born this very year!" if c==b else f"You are {str(c-b)+' year' if c-b<=1 else str(c-b)+' years'} old."

def calculate_age(year_of_birth, current_year):
    if current_year - year_of_birth == 1:
        return "You are 1 year old."
    elif year_of_birth - current_year == 1:
        return "You will be born in 1 year."
    elif current_year > year_of_birth:
        return f"You are {current_year-year_of_birth} years old."
    elif year_of_birth > current_year:
        return f"You will be born in {year_of_birth-current_year} years."
    else:
        return "You were born this very year!"


def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    text = "You were born this very year!"
    if age > 0:
        text = f"You are {age} year{'s'*(age>1)} old."
    elif age<0:
        text = f"You will be born in {abs(age)} year{'s'*(abs(age)>1)}."
    return  text

def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    
    if age > 0: return f"You are {age} years old." if age > 1 else "You are 1 year old."
    if age < 0: return "You will be born in 1 year." if age == -1 else f"You will be born in {abs(age)} years."
    return "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    years = current_year - year_of_birth
    
    
    if years == 0:
        return "You were born this very year!"
    elif years == 1:
        return "You are 1 year old." 
    elif years > 1:
        return f"You are {years} years old." 
    elif years == -1:
        return "You will be born in 1 year."
    else:
        return f"You will be born in {abs(years)} years."


def calculate_age(y, cy):
    r = cy-y
    y = "year" + ((abs(r)>1 or "") and "s")
    return f"You are {r} {y} old." if r > 0 else f"You will be born in {r*-1} {y}." if r<0 else "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    x = year_of_birth
    y = current_year
    if (x < y) and (y-x) == 1:
        return("You are" + " " + str(y-x) + " " + "year old.")
    elif x < y:
        return("You are" + " " + str(y-x) +" "+"years old.")
    elif (x > y) and (x-y) == 1:
        return("You will be born in" + " " + str(x-y)+ " " +"year.")
    elif x > y:
        return("You will be born in"+ " " + str(x-y)+ " " +"years.")
    else:
        return("You were born this very year!")
                      


def calculate_age(year_of_birth, current_year):
    diff=abs(year_of_birth-current_year)
    if diff==1 and year_of_birth<current_year:
        return f"You are {current_year-year_of_birth} year old."
    if diff!=1 and year_of_birth<current_year:
        return f"You are {current_year-year_of_birth} years old."
    if diff==1 and year_of_birth>current_year:
        return f"You will be born in {abs(current_year-year_of_birth)} year."
    if year_of_birth>current_year:
        return f"You will be born in {abs(current_year-year_of_birth)} years."
    else:
        return "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    return f"You are {age} year{'s' if age > 1 else ''} old." if age >= 1 \
        else f"You will be born in {abs(age)} year{'s' if age < -1 else ''}." if age < 0 \
        else "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    age = current_year-year_of_birth
    if age > 1:
        return 'You are {} years old.'.format(age)
    elif age == 0:
        return 'You were born this very year!'
    elif age < -1:
        return 'You will be born in {} years.'.format(-age)
    elif age == 1:
        return 'You are 1 year old.'
    elif age == -1:
        return 'You will be born in 1 year.'

def calculate_age(year_of_birth: int, current_year: int) -> str:
    """Year report depending on year of birth and current year."""
    def year_str(y:int) -> str:
        return "1 year" if y == 1 else str(y)+" years"
    delta = current_year - year_of_birth
    if delta == 0:
        return "You were born this very year!"
    elif delta > 0:
        return "You are " + year_str(delta) + " old."
    else:
        return "You will be born in " + year_str(-delta) + "."

def calculate_age(b, c):
    if b==c        : return 'You were born this very year!'
    if c-b == 1    : return 'You are 1 year old.'
    if c>b         : return 'You are {} years old.'.format(c-b)
    if b-c == 1    : return 'You will be born in 1 year.'
    if b>c         : return 'You will be born in {} years.'.format(b-c)

def calculate_age(year_of_birth, current_year):
    age = abs(year_of_birth - current_year)
    
    if year_of_birth < current_year:
        if age == 1:
            return 'You are {} year old.'.format(current_year - year_of_birth)
        return 'You are {} years old.'.format(current_year - year_of_birth)
    elif year_of_birth > current_year:
        if age == 1:
            return 'You will be born in {} year.'.format(year_of_birth - current_year)
        return 'You will be born in {} years.'.format(year_of_birth - current_year)
    else:
        return 'You were born this very year!'

def calculate_age(year_of_birth, current_year):
    age = abs(current_year - year_of_birth)
    if current_year - year_of_birth == 1: return 'You are 1 year old.'
    if current_year - year_of_birth == -1: return 'You will be born in 1 year.'
    if current_year > year_of_birth: return f'You are {age} years old.'
    if current_year < year_of_birth: return f'You will be born in {age} years.'
    else: return 'You were born this very year!'

def calculate_age(year_of_birth, current_year):
    diff = current_year - year_of_birth
    if diff > 1:
        return f'You are {diff} years old.' 
    elif diff<-1: 
        return f'You will be born in {-diff} years.'
    elif diff == -1:
        return f'You will be born in {-diff} year.'
    elif diff == 1:
        return f'You are {diff} year old.' 
    else:
        return 'You were born this very year!'#your code here

def calculate_age(year_of_birth, current_year):
    a = current_year - year_of_birth
    if a > 1:
        return f'You are {a} years old.'
    elif a == 0:
        return 'You were born this very year!'
    elif a == 1:
        return f'You are {a} year old.'
    elif a == -1:
        return f'You will be born in {abs(a)} year.'
    else:
        return f'You will be born in {abs(a)} years.'

def calculate_age(year_of_birth, current_year):
    gap = current_year - year_of_birth
    if gap > 0: return "You are {} year{} old.".format(gap, 's' if gap>1 else '')
    if gap < 0: return "You will be born in {} year{}.".format(-gap, 's' if gap<-1 else '')
    return "You were born this very year!"


def calculate_age(year_of_birth, current_year):
    if current_year - year_of_birth == 1:
        return "You are 1 year old."
    elif year_of_birth - current_year == 1:
        return "You will be born in 1 year."
    elif current_year - year_of_birth > 0:
        return "You are " + str(current_year - year_of_birth) + " years old."
    elif year_of_birth - current_year > 0:
        return "You will be born in " + str(year_of_birth - current_year) + " years."
    elif year_of_birth == current_year: 
        return "You were born this very year!"
  


def calculate_age(year_of_birth, current_year):
    if current_year > year_of_birth:
        if current_year-year_of_birth==1:
            return 'You are {} year old.'.format(current_year-year_of_birth)
        else:
            return 'You are {} years old.'.format(current_year-year_of_birth) 
    elif current_year==year_of_birth:
        return 'You were born this very year!'
    else:
        if year_of_birth-current_year==1:
            return 'You will be born in {} year.'.format(year_of_birth-current_year) 
        else:
            return 'You will be born in {} years.'.format(year_of_birth-current_year) 
        
        


def calculate_age(year_of_birth, current_year):
    s='s'
    if current_year>year_of_birth:
        return f'You are {current_year-year_of_birth} year{s if current_year-year_of_birth!=1 else ""} old.'
    if year_of_birth>current_year:
        return f'You will be born in {year_of_birth-current_year} year{s if -current_year+year_of_birth!=1 else ""}.'
    if year_of_birth==current_year:
        return 'You were born this very year!'


def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    if age == 0: return 'You were born this very year!'
    elif age == 1: return f'You are {age} year old.'
    elif age > 1: return f'You are {age} years old.'
    elif age ==-1: return f'You will be born in {-age} year.'
    else: return f'You will be born in {-age} years.'


def calculate_age(year_of_birth, current_year):
    if year_of_birth - current_year == 1:
        return "You will be born in 1 year."
    elif current_year - year_of_birth == 1:
        return "You are 1 year old."
    elif year_of_birth < current_year:
        return "You are {} years old.".format(current_year - year_of_birth)
    elif year_of_birth > current_year:
        return "You will be born in {} years.".format(year_of_birth - current_year)
    else: 
        return "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    if current_year == year_of_birth: return "You were born this very year!"
    elif current_year - year_of_birth == 1: return "You are 1 year old."
    elif current_year > year_of_birth: return "You are {} years old.".format(current_year - year_of_birth)
    elif current_year - year_of_birth == -1: return "You will be born in 1 year."
    else: return "You will be born in {} years.".format(year_of_birth - current_year)

def calculate_age(year_of_birth, current_year):
    if current_year-year_of_birth==1:
        return f'You are {current_year-year_of_birth} year old.'
    elif current_year > year_of_birth:
        return f'You are {current_year-year_of_birth} years old.'
    elif year_of_birth-current_year==1:
        return f'You will be born in {year_of_birth-current_year} year.'
    elif year_of_birth>current_year:
        return f'You will be born in {year_of_birth-current_year} years.'
    elif year_of_birth==current_year:
        return 'You were born this very year!'

def calculate_age(year_of_birth, current_year):
    x = year_of_birth
    y = current_year
    if x < y:
        if y - x == 1:
            return "You are 1 year old."
        else:
            w = str(y - x)
            return "You are " + w + " years old."
    elif x == y:
        return "You were born this very year!"
    elif x > y:
        if x - y == 1:
            return "You will be born in 1 year."
        else:
            k = str(x - y)
            return "You will be born in " + k + " years."

def calculate_age(year_of_birth, current_year):
    ad = current_year - year_of_birth    # Age Difference
    sfx = 's'*(abs(ad)>1)                # Suffix
    return "You were born this very year!" if ad is 0 else f"You will be born in {abs(ad)} year{sfx}." if ad < 0 else f"You are {ad} year{sfx} old."


def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    if age == 1:
        return "You are 1 year old."
    elif age == 0:
        return "You were born this very year!";
    elif age < -1:
        return "You will be born in " + str(-age) + " years.";
    elif age == -1:
        return "You will be born in 1 year.";
    else:
        return "You are " + str(age) +" years old.";

def calculate_age(year_of_birth, current_year):
    y =  current_year - year_of_birth
    if y == 0:
        return 'You were born this very year!'
    else:
        s = 's' if abs(y) != 1 else ''
        if y > 0:
            return 'You are {} year{} old.'.format(y, s)
        else:
            return 'You will be born in {} year{}.'.format(abs(y), s)
        


def calculate_age(a, b):
    if abs(a-b)>1:
        if b>a:
            return 'You are ' +str((b-a))+ ' years old.'
        elif b<a:
            return 'You will be born in '+str((a-b))+ ' years.'
    elif a-b==0:
        return 'You were born this very year!'
    elif b-a==1:
        return 'You are 1 year old.'
    elif a-b==1:
        return 'You will be born in 1 year.'

def calculate_age(y, c):
    if y<c:
        return "You are {} {} old.".format(c-y,("year" if c-y==1 else "years"))
    elif y>c:
        return "You will be born in {} {}.".format(y-c,("year" if y-c==1 else "years"))
    else:
        return "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    x = year_of_birth - current_year
    if x > 1:
        return 'You will be born in ' + str(x) + ' years.'
    if x < -1:
        return 'You are ' + str(-1*x) + ' years old.'
    if x == 0:
        return 'You were born this very year!'
    if x == -1:
        return 'You are 1 year old.'
    if x == 1:
        return 'You will be born in 1 year.'

def calculate_age(y, c):
    year= "years"
    if c+1== y or c-1==y or c==y:
        year = "year" 
    return "You are "  + str(c-y) +" "+ year + " old." if c>y else "You will be born in " \
    + str(y-c) +" "+ year + "." if y>c else "You were born this very "+ year + "!"

def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    if age == 1 :
        return "You are 1 year old."
    elif age == -1 :
        return "You will be born in 1 year."
    elif age > 0:
        return "You are {} years old.".format(age)
    elif age == 0:
        return "You were born this very year!"
    else:
        return "You will be born in {} years.".format(abs(age))

def calculate_age(year_of_birth, current_year):
    return "You were born this very year!" if year_of_birth == current_year else "You are {} year{} old.".format(current_year-year_of_birth, "s" if current_year-year_of_birth != 1 else "") if current_year > year_of_birth else "You will be born in {} year{}.".format(year_of_birth-current_year, "s" if current_year-year_of_birth != -1 else "")

def calculate_age(year_of_birth, current_year):
    y = current_year - year_of_birth
    if y == 1:
        return "You are 1 year old."
    elif y == -1:
        return "You will be born in 1 year."
    elif y > 1:
        return "You are {} years old.".format(y) 
    elif y < -1: 
        return "You will be born in {} years.".format(abs(y))
    elif y == 0:
        return "You were born this very year!" 

def calculate_age(year_of_birth, current_year):
    
    age = abs(current_year - year_of_birth)
    
    if year_of_birth < current_year:
        return f"You are {age} years old." if age > 1 else f"You are {age} year old."
    elif year_of_birth > current_year:
        return f"You will be born in {age} years." if age > 1 else f"You will be born in {age} year."
    else:
        return f"You were born this very year!"

def calculate_age(year_of_birth, current_year):
    difference=current_year-year_of_birth
    if difference<0:
        return "You will be born in " +str(abs(difference))+" years." if difference!=-1 else "You will be born in 1 year."
    elif difference>0:
        return "You are " +str(difference)+" years old." if difference!=1 else "You are 1 year old."
    return "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    if year_of_birth < current_year:
        yearsOld= current_year- year_of_birth
        if yearsOld==1:
            return "You are "+ str(yearsOld )+" year old."
        else:
            return "You are "+ str(yearsOld )+" years old."
    elif year_of_birth > current_year:
        yearsOld= year_of_birth - current_year
        if yearsOld==1:
            return "You will be born in "+ str(yearsOld )+" year."
        else:
            return "You will be born in "+ str(yearsOld )+" years."
    elif year_of_birth == current_year:
        yearsOld= year_of_birth
        return "You were born this very year!"
    #your code here


def calculate_age(year_of_birth, current_year):
    if year_of_birth > current_year :
        if year_of_birth - current_year == 1 :
            return "You will be born in 1 year."
        return f"You will be born in {year_of_birth - current_year} years."
    elif year_of_birth < current_year :
        if current_year - year_of_birth == 1 :
            return "You are 1 year old."
        return f"You are {current_year - year_of_birth} years old."
    else :
        return "You were born this very year!"


def calculate_age(y, c):
    if c-y==1:
        return f'You are 1 year old.'
    if y-c==1:
        return f'You will be born in 1 year.'
    if c>y:
        return f'You are {c-y} years old.'
    if c<y:
        return f'You will be born in {y-c} years.'
    if c==y:
        return 'You were born this very year!'

def calculate_age(year_of_birth, current_year):
    if year_of_birth == current_year:
        return "You were born this very year!"
    elif year_of_birth - current_year == 1:
        return f"You will be born in 1 year."
    elif current_year - year_of_birth == 1:
        return f"You are 1 year old."
    elif year_of_birth < current_year:
        return f"You are {current_year - year_of_birth} years old."
    else:
        return f"You will be born in {year_of_birth - current_year} years."

def calculate_age(yb, cy):
    if cy - yb == 1:
        return f'You are 1 year old.'
    if cy - yb > 1:
        return f'You are {cy-yb} years old.'
    if cy - yb == -1:
        return f'You will be born in 1 year.'
    if cy - yb < -1:
        return f'You will be born in {yb-cy} years.'
    return f'You were born this very year!'

def calculate_age(year_of_birth, current_year):
    out = current_year - year_of_birth
    if out == 1:
        return f'You are {out} year old.'
    elif out == 0:
        return 'You were born this very year!'
    elif out > 1:
        return f'You are {out} years old.'
    elif out == -1:
        return f'You will be born in {abs(out)} year.'
    else:
        return f'You will be born in {abs(out)} years.'

def calculate_age(yob, cy):
    #your code here
    if yob<cy:
        if (cy-yob)==1:
            return f"You are {cy-yob} year old."
        return f"You are {cy-yob} years old."
    elif yob>cy:
        if (yob-cy)==1:
            return f"You will be born in {yob-cy} year."
        return f"You will be born in {yob-cy} years."
    else:
        return "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    if year_of_birth == current_year:
        return "You were born this very year!"
    elif (year_of_birth - current_year) == -1:
        return "You are 1 year old."
    elif (year_of_birth - current_year) == 1:
        return "You will be born in 1 year."
    elif year_of_birth < current_year:
        return "You are {} years old.".format(abs(year_of_birth-current_year))
    else:
         return "You will be born in {} years.".format(year_of_birth-current_year)

def calculate_age(year_of_birth, current_year):
    if current_year == year_of_birth:
        return "You were born this very year!"
    elif year_of_birth - current_year == 1:
        return "You will be born in 1 year."
    elif year_of_birth > current_year + 1:
        return "You will be born in " + str(int(year_of_birth - current_year)) + " years."
    elif current_year - year_of_birth == 1:
        return "You are 1 year old."
    elif current_year > year_of_birth + 1:
        return "You are " + str(int(current_year - year_of_birth)) + " years old."

def calculate_age(b, c):
    d=c-b
    return  (d>0)  * f"You are {d} year{'s'*(d>1)} old." +\
            (d<0)  * f"You will be born in {-d} year{'s'*(d<-1)}." +\
            (d==0) * "You were born this very year!"

def calculate_age(year_of_birth, current_year):
    y = current_year - year_of_birth
    if y > 0:
        return "You are {} {} old.".format(y, "years" if y !=1 else "year")
    elif y == 0:
        return "You were born this very year!"
    else:
        return "You will be born in {} {}.".format(-y, "years" if y !=-1 else "year")

def calculate_age(year_of_birth, current_year):
    if current_year<year_of_birth:
        if current_year-year_of_birth==-1:
            return 'You will be born in 1 year.'
        else:
            return 'You will be born in '+ str(year_of_birth-current_year) +' years.'
    elif  current_year>year_of_birth:
        if current_year-year_of_birth==1:
            return 'You are 1 year old.'
        else:
            return 'You are '+str(current_year-year_of_birth)+' years old.'
    else:
        return 'You were born this very year!'

def calculate_age(year_of_birth, current_year):
    work=current_year-year_of_birth
    if work==1 : return "You are 1 year old."
    elif work>0 : return "You are {} years old.".format(work)
    elif work==0 : return "You were born this very year!"
    elif work==-1 : return "You will be born in 1 year."
    elif work<0 : return "You will be born in {} years.".format(-work)

def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    
    if age == 1:
        return "You are %s year old." % age
    if age > 1:
        return "You are %s years old." % age
    if age == 0:
        return "You were born this very year!"
    if age == -1:
        return "You will be born in %s year." % abs(age)

    else:
        return "You will be born in %s years." % abs(age)

def calculate_age(year_of_birth, current_year):
    if year_of_birth > current_year:
            diff = year_of_birth - current_year
            if diff == 1:
                return f"You will be born in {diff} year."
            else:
                return f"You will be born in {diff} years."
    elif year_of_birth == current_year:
        return "You were born this very year!"
    else:
        diff = current_year - year_of_birth
        if diff == 1:
            return f"You are {diff} year old."
        else:
            return f"You are {diff} years old."

def calculate_age(year_of_birth, current_year):
    age = current_year - year_of_birth
    if age > 1:
        return f"You are {age} years old."
    elif age == 1:
        return f"You are {age} year old."
    elif age == 0:
        return f"You were born this very year!"
    if age == -1:
        return f"You will be born in {-age} year."
    if age < -1:
        return f"You will be born in {-age} years."

def calculate_age(year_of_birth, current_year):
    if current_year - year_of_birth == 1:
        return "You are " + str(current_year - year_of_birth) + " year old."
    elif year_of_birth - current_year == 1:
        return "You will be born in " + str(year_of_birth - current_year) + " year."
    elif current_year - year_of_birth > 0:
        return "You are " + str(current_year - year_of_birth) + " years old."
    elif current_year == year_of_birth:
        return "You were born this very year!"
    else:
        return "You will be born in " + str(year_of_birth - current_year) + " years."

def calculate_age(year_of_birth, current_year):
    old = current_year - year_of_birth
    if old > 0:
        return "You are {} year{} old.".format(old, "s" if old > 1 else "")
    elif old < 0:
        return "You will be born in {} year{}.".format(abs(old), "s" if abs(old) > 1 else "")
    else: 
        return 'You were born this very year!'


def calculate_age(year_of_birth, current_year):
    years = current_year - year_of_birth
    if not years:
        return 'You were born this very year!'
    elif years > 0:
        return f'You are {years} year{"" if years == 1 else "s"} old.'
    return f'You will be born in {-years} year{"" if years == -1 else "s"}.'

def calculate_age(year_of_birth, current_year):
    #your code here
    age = current_year-year_of_birth
    if abs(age)==1:
        unit = 'year'
    else:
        unit = 'years'
    if age==0:
        return "You were born this very year!"
    if age>0:
        return "You are "+str(age)+" "+unit+" old."
    else:
        return "You will be born in "+str(abs(age))+" "+unit+"."

def calculate_age(year_of_birth, current_year):
    x = current_year - year_of_birth
    if x < 0: return f"You will be born in {abs(x)} year{'s' if abs(x)>1 else ''}."
    if x == 0: return "You were born this very year!"
    return f"You are {x} year{'s' if x > 1 else ''} old."

def calculate_age(year_of_birth, current_year):
    diff = year_of_birth - current_year
    if diff == 0:
        return "You were born this very year!"
    elif  diff > 0:
        return "You will be born in {} {}.".format(diff, "year" if diff == 1 else "years")
    elif diff < 0:
        return "You are {} {} old.".format(abs(diff), "year" if diff == -1 else "years")

def calculate_age(birthyear, target):
    if birthyear == target:
        return 'You were born this very year!'
    elif birthyear > target:
        return 'You will be born in {} year{}.'.format(birthyear - target, 's' * ((birthyear - target) > 1))
    else:
        return 'You are {} year{} old.'.format(target - birthyear, 's' * ((target - birthyear) > 1 ))

def calculate_age(year_of_birth, current_year):
    if current_year - year_of_birth > 1:
        return f"You are {current_year - year_of_birth} years old."
    elif current_year - year_of_birth == 1:
        return f"You are {current_year - year_of_birth} year old."
    elif current_year - year_of_birth == -1:
        return f"You will be born in {-(current_year - year_of_birth)} year."
    elif current_year - year_of_birth < -1:
        return f"You will be born in {-(current_year - year_of_birth)} years."
    else:
        return "You were born this very year!"


def calculate_age(year_of_birth, current_year):
    age=current_year-year_of_birth
    if age==0: return 'You were born this very year!'
    if age>0: return 'You are {} year{} old.'.format(age, 's' if age>1 else '')
    if age<0: return 'You will be born in {} year{}.'.format(abs(age), 's' if age<-1 else '')

def calculate_age(yob, cy):
    if yob<cy and cy-yob==1: return f"You are 1 year old."
    if yob<cy: return f"You are {cy-yob} years old." 
    if yob>cy and yob-cy==1: return f"You will be born in 1 year."
    if yob>cy: return  f"You will be born in {yob-cy} years."   
    if yob==cy: return 'You were born this very year!'

def calculate_age(b, c):

    greet = ["You will be born in {} year{}.","You are {} year{} old.","You were born this very year!"]
    return greet[2] if b == c else greet[b<c].format(abs(b-c),'s' if abs(b-c)!=1 else '')