Timeline for Coding exercise to represent an integer as words using python
Current License: CC BY-SA 4.0
29 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 1, 2024 at 1:33 | comment | added | Nayuki | You could steal some ideas from nayuki.io/page/knuths-yllion-number-notation, in particular nayuki.io/res/knuths-yllion-number-notation/integer-to-words.py class ConventionalEnglishNotation | |
| Sep 2, 2024 at 21:46 | comment | added | Ben Voigt | @AdrianMcCarthy: It's a bug in the specification, the description "Convert a non-negative integer" conflicts with the stated constraint "num is strictly greater than zero" | |
| Sep 2, 2024 at 19:40 | comment | added | user272752 | @TobySpeight re: "strange" or "foreign"... And then there's this... | |
| Sep 2, 2024 at 12:53 | comment | added | Toby Speight | @Fe2O3, you might like to know that we've been using American billions in Britain for many decades now. (Perhaps I should have said "strange" or "foreign" rather than "wrong" - or emphasised the "to me"!) | |
| Sep 2, 2024 at 12:33 | comment | added | user272752 | @TobySpeight It's not "wrong". It's no more than an alternative convention that's accepted and understood by millions (perhaps "American, not British" billions) of people around the world. (FYI, a "British billion" is 1000x more than an "American billion"). In conclusion, "and" is only one of a plethora of options/standards/conventions available when communicating. | |
| Sep 2, 2024 at 10:47 | comment | added | Toby Speight | Oh, it seems Americans routinely omit the "and". If you're writing for them, I suppose you could do the same. It still sounds/looks wrong to me. | |
| Sep 2, 2024 at 9:25 | comment | added | user272752 | @TobySpeight re: "and"... The debate rages. imo, a beginner task should be as straightforward as possible... You may as well ask if the 'house number' of the Whitehouse is "sixteen hundred" or "one thousand six hundred"... Remember KISS principles... | |
| Sep 1, 2024 at 22:07 | comment | added | Dawood ibn Kareem | Many mathematicians will leave out the word "and" from numbers like 123. It makes it possible to distinguish "123/200" from "100 23/200". | |
| Sep 1, 2024 at 21:48 | comment | added | Stef | Next exercise: write the inverse function, that converts English like "one hundred and twenty-three" into integers ;-) (it's actually simpler) | |
| S Sep 1, 2024 at 16:18 | vote | accept | Silah | ||
| Sep 1, 2024 at 16:01 | comment | added | Silah | I know it’s wrong in English. I was coding it for a friend , gave it a try as a beginner. I followed the question as it was given to me . | |
| S Sep 1, 2024 at 15:57 | vote | accept | Silah | ||
| S Sep 1, 2024 at 16:18 | |||||
| S Sep 1, 2024 at 15:57 | vote | accept | Silah | ||
| S Sep 1, 2024 at 15:57 | |||||
| Sep 1, 2024 at 9:19 | comment | added | Toby Speight | Your output omits the "and" from e.g. "one hundred and twenty-three" - is that intentional? | |
| Aug 31, 2024 at 14:34 | comment | added | Adrian McCarthy | I'm surprised the specification omits 0. | |
| Aug 31, 2024 at 13:51 | answer | added | Reinderien | timeline score: 10 | |
| Aug 31, 2024 at 13:10 | history | became hot network question | |||
| Aug 31, 2024 at 11:58 | answer | added | toolic | timeline score: 8 | |
| Aug 31, 2024 at 11:57 | history | edited | toolic | CC BY-SA 4.0 | deleted 4 characters in body |
| Aug 31, 2024 at 11:50 | vote | accept | Silah | ||
| S Sep 1, 2024 at 15:57 | |||||
| Aug 31, 2024 at 8:23 | answer | added | Luke L | timeline score: 5 | |
| Aug 31, 2024 at 6:15 | comment | added | Silah | I used autopep8 as a start after you suggested autoformatting,still learning. | |
| Aug 31, 2024 at 6:14 | history | edited | Silah | CC BY-SA 4.0 | I used autopep8 to format |
| Aug 31, 2024 at 5:49 | comment | added | ggorlen | You might want to consider using linting, autoformatting and following PEP-8. | |
| Aug 31, 2024 at 5:39 | history | edited | Silah | CC BY-SA 4.0 | added 13 characters in body |
| Aug 31, 2024 at 5:30 | comment | added | user272752 | First comment: What happened to 11? Note how thoughtful layout can help prevent bugs... | |
| Aug 31, 2024 at 5:28 | history | edited | Silah | edited tags | |
| Aug 31, 2024 at 5:15 | history | edited | Silah | CC BY-SA 4.0 | added 27 characters in body |
| Aug 31, 2024 at 5:10 | history | asked | Silah | CC BY-SA 4.0 |