+ 1
Why is it not working?
x= input() d={"0":"zero","1":"one","2":"two","3":"three","4":"four","5":"five","6":"six","7":"seven","8":"eight","9":"nine"} for i in x: if i.isdigit(): c=d[i] x.replace(i,c) print (x)
3 Respuestas
+ 3
The .replace() doesn't change the original variable. So you can assign it to a new variable or same:
https://code.sololearn.com/ccGd0Kh81e5X/?ref=app
+ 4
PythonPip good
+ 1
Yes
I got it .
This should be like this
X=x.replace(str(i),d[i])