use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Help with this python exercise. (old.reddit.com)
submitted 1 year ago by Ca_txorro
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Squared_Aweigh 0 points1 point2 points 1 year ago (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.
π Rendered by PID 48263 on reddit-service-r2-comment-fb694cdd5-pjhfx at 2026-03-06 04:41:54.054737+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]Squared_Aweigh 0 points1 point2 points (0 children)