- 1
Solved: No numerals
import re txt= input() numes ={"0":"zero","1":"one","2":"two","3":"three","4":"four","5":"five","6":"six","7":"seven","8":"eight","9":"nine","10":"ten"} for gi in txt.split(): if gi in numes: txt =re.sub(gi,numes[gi],txt) print(txt)
4 odpowiedzi
+ 4
Solved...!
Then why this in q/a?
You can share in feed post or in special thread for code advertisement. So use those.. But posting here is spamming.
edit:
https://www.sololearn.com/discuss/1316935/?ref=app
https://www.sololearn.com/discuss/333866/?ref=app
+ 3
Israel Mutebi ,
maybe there can be done an improvment:
this input: hello 1 2 3 4 5 6 7 8 9 10 11 12 100
results in: hello one two three four five six seven eight nine one0 oneone onetwo one00
+ 2
Israel Mutebi ,
maybe you can have a look at this codes gives you an idea how to do the task with re.sub()
https://code.sololearn.com/cuenyCP0qTCr/?ref=app
0
Thx Lothar
Let me try this out also