Ad
Code
Diff
  • converter = lambda n: ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"][n] if n < 10 else None
    • def converter(number):
    • try:
    • return ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"][number]
    • except IndexError:
    • return None
    • converter = lambda n: ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"][n] if n < 10 else None