+ 2
No Numerals code coaching
I didn't get what was gone wrong with my code in "No Numerals" coding concepts's case 3? https://sololearn.com/compiler-playground/c5gn18yeTVUL/?ref=app
4 Answers
+ 4
Given "10 years" for input, the code outputs "onezero years" while "ten years" was expected.
+ 3
Surajit Roy ,
this part of the code causes an issue:
we have 2 nested loops, this is not required.
...
words = phrase.split()
updated_words = []
#for word in words: NOT required
new_word = ' '.join([digit_to_word[word] if word in digit_to_word else word for word in words])
^ space needed ^^^^^^^ needs to be the splitted list
updated_words.append(new_word)
return ' '.join(updated_words)
...
0
I got it
0
Can you help me to explain python