DEV Community

Discussion on: Daily Challenge #234 - Happy Birthday!

Collapse
 
peter279k profile image
peter279k

Here is the Python solution:

def womens_age(n):
    str_format = "%s? That's just %s, in base %s!"

    base = int(n / 2)
    age = 21
    if n % 2 == 0:
        age = 20


    return str_format %(n, age, base)