I have a table with words numbers
table = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten']
And the user should wrote a number in input:
number = input()
Now I need to create function printing word representation in that way (eg. for 242):
> 242 - two four two
I wrote that code but it's not working propetly (problem with indexes or printing list). How can I do that function in esiest way?
My tried code:
table=['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten']
number = input()
for x in range(len(table)):
print(table[number[x]], end=' ')