#decades into words

2 messages · Page 1 of 1 (latest)

wooden valleyBOT
#

Thanks for your question :clap:, if someone gives you an answer it would be great if you thanked them with a :white_check_mark: in response. This response will earn you both points for special roles on this server.

ionic berry
#

maybe there is a function, but spontaneously my solution would be kind of like this

def decade_to_word(decade: int) -> str:
    match decade:
        case 1980:
            return "ninteeneighties"
        case 1990:
            return "ninteenninties"
        case 2000:
            return "twothousands"
        case _:
            return "something else"

print(decade_to_word(1980))

output:

ninteeneighties