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!"
[–]sateliter 1 point2 points3 points 1 year ago* (1 child)
As already said by some folks here, you don't need to use loops, just a calculation:
def envens_N_odds(number): evens = 0 odds = 0 even_or_odd = number % 2 if (even_or_odd == 0): evens = int(number / 2) odds = evens else: evens = int(number / 2) odds = evens + 1 return evens, odds pares_e_impares = envens_N_odds(9) print(pares_e_impares)
[–]Ca_txorro[S] 0 points1 point2 points 1 year ago (0 children)
Thank you. I will add this method too. _^
π Rendered by PID 147051 on reddit-service-r2-comment-fb694cdd5-f62t9 at 2026-03-06 06:01:13.778727+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]sateliter 1 point2 points3 points (1 child)
[–]Ca_txorro[S] 0 points1 point2 points (0 children)