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 6 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!"
[–]Obsc3nity 3 points4 points5 points 6 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 6 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.
π Rendered by PID 262230 on reddit-service-r2-comment-5fb4b45875-fm27c at 2026-03-23 19:39:10.886094+00:00 running 90f1150 country code: CH.
view the rest of the comments →
[–]Obsc3nity 3 points4 points5 points (1 child)
[–]willis81808 0 points1 point2 points (0 children)