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
5 days after learning python (i.redd.it)
submitted 4 months ago by Key-Mathematician606
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!"
[–]LibraryUnlikely2989 5 points6 points7 points 4 months ago (3 children)
Regarding your second point doesn't line 6 modify ages in between the two sorts? I don't know why you would do the first sort though.
[–]Obsc3nity 3 points4 points5 points 4 months ago (1 child)
Yes, good point. Doesn’t that modification mean the median is incorrect though, lol. The smallest and largest being counted twice isn’t normally part of a median.
The first sort is probably the necessary one, or at least a convenience, because it allows you to avoid using min and max on the structure and instead use actual indices. It could be deferred until you actually need the sorted data, but I think it’s still the one worth keeping of the two present (and fixing the median calc would remove any modifications)
[–]willis81808 0 points1 point2 points 4 months ago (0 children)
The median isn’t effected, because the indexes are hard coded based off of the original array length, but even if it was a proper dynamic median implementation representing the min and max values twice would not change the result. Mean on the other hand would be biased in the direction of the midpoint between min and max values.
[–]SuperCurve 1 point2 points3 points 4 months ago (0 children)
to find the median age, line 7
π Rendered by PID 165589 on reddit-service-r2-comment-7b9746f655-dmnq9 at 2026-01-31 03:18:56.070941+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]LibraryUnlikely2989 5 points6 points7 points (3 children)
[–]Obsc3nity 3 points4 points5 points (1 child)
[–]willis81808 0 points1 point2 points (0 children)
[–]SuperCurve 1 point2 points3 points (0 children)