Created
May 18, 2022 11:05
-
-
Save bmispelon/76f951a16f566d94636361af4f14943e to your computer and use it in GitHub Desktop.
Convert an integer into english
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, unicodedata | |
def int_to_english(n: int) -> str: | |
""" | |
Convert the given integer into english (only works reliably for numbers between 1 and 31). | |
""" | |
return unicodedata.name(chr(13279 + n)).split()[-1] | |
if __name__ == '__main__': | |
print(int_to_english(int(sys.argv[1]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment