0

why is one test case alwsys failing here?

https://www.sololearn.com/coach/64?ref=app word=str(input()) x=word.split() for i in range(len(x)): if(x[i].isalpha()==False): if(int(x[i])==0): x[i]="zero" elif(int(x[i])==1): x[i]="one" elif(int(x[i])==2): x[i]="two" elif(int(x[i])==3): x[i]="three" elif(int(x[i])==4): x[i]="four" elif(int(x[i])==5): x[i]="five" elif(int(x[i])==6): x[i]="six" elif(int(x[i])==7): x[i]="seven" elif(int(x[i])==8): x[i]="eight" elif(int(x[i])==9): x[i]="nine" else: x[i]=x[i] str1=' '.join(map(str,x)) print(str1)

11th Apr 2020, 1:24 AM
Samyuktha Mohan Alagiri
Samyuktha Mohan Alagiri - avatar
2 Respostas
+ 1
"Take a phrase and replace any instances of an integer from 0-10 and replace it with the English word that corresponds to that integer." 10 = ten ;)
11th Apr 2020, 3:16 AM
Denise Roßberg
Denise Roßberg - avatar
0
Post the code
11th Apr 2020, 2:10 AM
Justus
Justus - avatar