Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second3.3 solution in Uncategorized category for Speech Module by bryukh
def checkio(number):
units = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
tens = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
nb_str = ""
if (int(number / 100) % 10) > 0:
nb_str += units[int(number / 100) % 100] + " hundred "
if (int(number / 10) % 10) > 1:
nb_str += tens[int(number / 10) % 10] + " "
if (int(number / 10) % 10) == 1:
nb_str += units[number % 100]
elif (int(number % 10)) >= 1:
nb_str += units[number % 10]
return nb_str.strip()
Dec. 12, 2012
Comments: