Talk:Convert seconds to compound duration: Difference between revisions

→‎About the python examples: about the "0 seconds" case
(→‎About the python examples: about the "0 seconds" case)
Line 17:
 
: Meanwhile, as a curiosity question - would the python language spec lose anything if it were changed so that prompts (at least the default prompt) were neutral? Copy and paste of lines containing previously run statements is indeed a handy tool... --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 11:42, 7 June 2015 (UTC)
 
: I hadn't thought about the 0 specifically, but I did qualify the problem statement by writing that the function "takes a positive integer" (which I wrote to exclude negative numbers, but actually excludes the 0 as well). In other words: An input of 0 is outside the scope of the task. You can handle it however you want. In practice, the cleanest way would be to reject non-positive numbers with a descriptive error message, but such boiler-plate input validation is not what the task is meant to be about, so it is not mandatory. Simply assuming that the function will only be called with positive numbers, is fine for this task. --[[User:Smls|Smls]] ([[User talk:Smls|talk]]) 12:30, 7 June 2015 (UTC)
Anonymous user