0
Where is my error ? Problem no numerals
a=input() for i in a: if(i=="0"): print("zero",end="") elif (i=="1"): print ("one",end="") elif (i=="2"): print ("two",end="") elif (i=="3"): print ("three",end="") elif (i=="4"): print ("four",end="") elif (i=="5"): print ("five",end="") elif (i=="6"): print ("six",end="") elif (i=="7"): print ("seven",end="") elif (i=="8"): print ("eight",end="") elif (i=="9"): print ("nine",end="") elif (i=="10"): print ("ten",end="") else: print (i,end="")
3 Answers
+ 8
Dadaxon Xudayberganov 🇺🇿🇺🇿🇺🇿 ,
> to replace the digits by a *word-number*, we have to split the input sentence to a list of individual words.
> after this we can iterate over this list and start the replacement and the output.
+ 2
Loop iterates by each single character so it never reads "10" by loop.. and will be read as "1"," 0".
0
O, I forget it, thanks