+ 2

Write a Python code to read an integer in a file e.g 123 and convert it to words e.g One hundred and twenty three and write the

23rd Apr 2021, 6:16 PM
Vinay
Vinay - avatar
9 Answers
+ 1
# ok, I figured out a clean and short way using indexes which could be extended to meet your requirements, check this out l = ["zero","one","two","three","four","five","six","seven","eight","nine","ten"] # add as much as you need written mumbers in the list for num in range(len(l)): print(f"{num}: {l[num]}") # output 0: zero 1: one 2: two 3: three 4: four 5: five 6: six 7: seven 8: eight 9: nine 10: ten
23rd Apr 2021, 7:47 PM
iTech
iTech - avatar
+ 1
Only logic is important.Nothing else doesn't matter whatever language python or java. I am also comfortable in java.
24th Apr 2021, 6:54 PM
Vinay
Vinay - avatar
0
Help me please
23rd Apr 2021, 6:16 PM
Vinay
Vinay - avatar
0
Hi! You start write a Python code?
23rd Apr 2021, 6:49 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Thanks everyone this helps me lot
24th Apr 2021, 4:23 PM
Vinay
Vinay - avatar
0
šŸ…°šŸ…¹ (Challenge Accepted) you are posting Java and JS code which is out of the scope while the dude asked for python and you complained me for requirements šŸ¤£šŸ¤£šŸ¤£šŸ¤£šŸ¤£ my code is the core logic, I assume the dude knows how to CRUD a file in python. if your answer was on stackoverflow you should been received +100 downvotes and a freeze!
24th Apr 2021, 6:25 PM
iTech
iTech - avatar
0
iTech Doesn't matter on language. Every languages have same logic only syntax change. I gave him 2 example to know how to do that. If you don't understand then don't give unnecessary answer.
24th Apr 2021, 6:50 PM
AĶ¢J
AĶ¢J - avatar
0
Vinay your question tag is python3 nor java neither js. every detail count! answer must be relevant to the question. its true this is not stackoverflow but come on, at least a minimum of compliance is required.
24th Apr 2021, 8:28 PM
iTech
iTech - avatar
0
I know it's not relevant .But I understand java .So, it's ok to me.thanks a lot for helping me šŸ™
25th Apr 2021, 3:26 AM
Vinay
Vinay - avatar