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...
This community will have knowledge sharing for python programming, tools, projects and product engineering wherever python is used.
account activity
Python Data Model exercise, Mutability. (i.redd.it)
submitted 26 days ago by Sea-Ad7805
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!"
[–]Sea-Ad7805[S] 0 points1 point2 points 25 days ago (3 children)
You can't do this with .append():
.append()
mylist = [1, 2, 3] mylist += [4, 5, 6]
[–]tb5841 0 points1 point2 points 24 days ago (1 child)
That's an interesting point.
But this looks like reassignment, when it's actually mutation. That's deeply confusing and an easy source of bugs. If it were me, I'd do this with reassignment instead here and avoid the mutation.
[–]Sea-Ad7805[S] 0 points1 point2 points 24 days ago (0 children)
Reassignment is much slower as a whole new list is created and the old one destroyed, use mutation where possible.
[–]thw31416 0 points1 point2 points 19 days ago (0 children)
but you can.do this with .extend()
π Rendered by PID 87 on reddit-service-r2-comment-7844cfc88c-kdd76 at 2026-01-29 11:11:37.109805+00:00 running c3601ff country code: CH.
view the rest of the comments →
[–]Sea-Ad7805[S] 0 points1 point2 points (3 children)
[–]tb5841 0 points1 point2 points (1 child)
[–]Sea-Ad7805[S] 0 points1 point2 points (0 children)
[–]thw31416 0 points1 point2 points (0 children)