problem no numerals | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

problem no numerals

only passing 3 test 1,2 and i think it was 5 failing all otheres dict={"0":"zero","1":"one","2":"two","3":"three","4":"four","5":"five","6":"six","7":"seven","8":"eight","9":"nine","10":"ten"} x=input() for w in x: if w=="10" or w in dict.keys(): z=x.replace(w,dict.get(w)) print(z) i also tried another approach and the output is appearing on different lines so it isnt accepting it https://code.sololearn.com/c2I2UxZNPdag/?ref=app

4th May 2020, 8:09 AM
Abdul Majeed Faraz
Abdul Majeed Faraz - avatar
4 Answers
+ 3
num=("zero","one","two","three","four","five","six","seven","eight","nine","ten") x=input() z=x.split() for i in z: if i.isdigit(): y=num[int(i)] print(y,end=" ") else: print(i,end=" ") You only missed end parameter in print statement of if condition...Now it's working properly☺️
4th May 2020, 8:34 AM
ANJALI SAHU
+ 3
thanks for the answer i will try it later🤗
4th May 2020, 9:21 AM
Abdul Majeed Faraz
Abdul Majeed Faraz - avatar
+ 3
thanks it worked
4th May 2020, 10:14 AM
Abdul Majeed Faraz
Abdul Majeed Faraz - avatar
+ 2
☺️
4th May 2020, 9:24 AM
ANJALI SAHU