Algorithms
Logic
Get every nth word in the string.
Write code that converts number(0-9) to string(zero-nine)
def converter(number): if 0<=number<10: return ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"][int(number)] else: return None
- def converter(number):
if number == 0:return "zero"elif number == 5:return "five"return number- if 0<=number<10:
- return ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"][int(number)]
- else:
- return None