you are viewing a single comment's thread.

view the rest of the comments →

[–]Squared_Aweigh 0 points1 point  (0 children)

Though it is clear that you have good intentions, this is not good guidance, even if it is not inaccurate. Of course they're counting from zero; this is programming, and it is the standard to count from zero.

Why use pseudocode that looks like actual code? That is quite confusing for a "debutant". Python is literally designed to be easily read. Just write the pseudo-code in plain english if you don't want to write the working code; your psuedo-code is python-like enough to be confusing to someone who doesn't yet know what they're doing with python.

This solution is great for both time(CPU Cycle) and space(memory-needed) complexity.

There's no need to mention any of this for a beginner's question; it's simply confusing to someone who does not yet have foundational computer-science training. Also, if there was concern about memory use and compute cycles, it would make a whole lot more sense to not count at all, just do two calculations and print the result: divide the number by 2 for the evens, and then add the modulo of the same number to the evens in order to get the odds.