# Swift's closure
#   https://d...content-available-to-author-only...e.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Closures.html


digitNames = {
    0: "Zero", 1: "One", 2: "Two",   3: "Three", 4: "Four",
    5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine"
}
numbers = [16, 58, 510]


def convert_number_to_string(number):
    output = ''
    while number > 0:
        output = digitNames[number % 10] + output
        number /= 10

    return output


strings = map(convert_number_to_string, numbers)


for s in strings:
    print(s)