+ 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
4 odpowiedzi
+ 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☺️
+ 3
thanks for the answer i will try it later🤗
+ 3
thanks it worked
+ 2
☺️