+ 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

26th Aug 2024, 4:24 AM
Surajit Roy
Surajit Roy - avatar
4 Answers
+ 4
Given "10 years" for input, the code outputs "onezero years" while "ten years" was expected.
26th Aug 2024, 7:49 AM
Ipang
+ 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) ...
26th Aug 2024, 11:26 AM
Lothar
Lothar - avatar
0
I got it
26th Aug 2024, 11:23 AM
Surajit Roy
Surajit Roy - avatar
0
Can you help me to explain python
26th Aug 2024, 10:05 PM
dipika Verma.
dipika Verma. - avatar