Python Forum
convert words to nums and vica versa
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
convert words to nums and vica versa
#1
Hi everyone,

just started learning python3 at university. We got a homework and I do not litterally know where to start.
We are asked to make a program that converts numbers from 0-999999 to words. for example: input: 587 output: fivehundredeightyseven.

And the same vica versa: input: onetohursandfivehundredseventytwo outut: 1572

I unferstand from my little experience that I will make something like: nums=["one", "two"..."thoursand"].
But I do not know how to create the algoritm for reading the input. to recognise that twohundred= "two" + "hundred". the input and output is supposed to be without spaces everytime.

I would appriciate so much if anyone helps me... Even better if someone gives me some contact and I will be able to write to the same person with some problems during programming...

Have a nice day everyone.
Reply


Messages In This Thread
convert words to nums and vica versa - by Nimtram - Oct-24-2018, 07:17 AM
RE: convert words to nums and vica versa - by buran - Oct-24-2018, 07:58 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020