No numeral | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 11

No numeral

Does anyone have sixth case test? Is the following code incorrect? text = input() t = text.split() lengh = len(t) for i in range(0,lengh): if t[i]=='0': t[i]='zero' if t[i]=='1': t[i]='one' if t[i]=='2': t[i]=='two' if t[i]=='3': t[i]='three' if t[i]=='4': t[i]='four' if t[i]=='5': t[i]='five' if t[i]=='6': t[i]='six' if t[i]=='7': t[i]='seven' if t[i]=='8': t[i]='eight' if t[i]=='9': t[i]='nine' elif t[i]=='10': t[i]='ten' print(' '.join(t))

8th May 2020, 7:24 PM
Zahra P
Zahra P - avatar
10 Answers
+ 6
import re dic = {'1':'one', '2':'two', '3':'three', '4':'four', '5':'five', '6':'six', '7':'seven', '8':'eight','9':'nine', '0' : 'zero','10':'ten'} s = input() ne = s.split(' ') for i in ne: if(i in dic): s = s.replace(i,dic[i]) print(s)
8th May 2020, 7:46 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
+ 11
Please do not continue this pointless discussion.🌸🌸
8th May 2020, 8:06 PM
Zahra P
Zahra P - avatar
+ 11
Rithea Sreng Thanks🌸
11th May 2020, 1:21 PM
Zahra P
Zahra P - avatar
+ 10
Sami Khan Oh Sorry Guilty editor
8th May 2020, 7:51 PM
Zahra P
Zahra P - avatar
+ 8
Sami Khan Thanks
8th May 2020, 7:47 PM
Zahra P
Zahra P - avatar
+ 2
Zahra P it's ok.. just make sure sure it's "Sami" Khan 😒😒
8th May 2020, 7:48 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
+ 2
Abhay it was mentioned in the question "six case test" and question title is no numeral.. that should be enough to guess..
8th May 2020, 8:00 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
+ 2
Abhay well then, u should have tried, to guess around.. I have been guessing around in this Q&A sections for almost 4 years. I've got the skills to guess.
8th May 2020, 8:07 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
As 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 said question isn't complete ,how do people know that no numeral is a code coach question? Also you didn't linked the code so we could see what wrong you are doing in order to correct it
8th May 2020, 7:53 PM
Abhay
Abhay - avatar
0
Sami Khan yup only for you I guess ,how do those who don't know about code coach will understand anything from sixth case test? and also you provided answer instead of asking for the code from questionnaire to see what mistake they maybe doing and then correct that
8th May 2020, 8:03 PM
Abhay
Abhay - avatar