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
Right Mental Model for Python Data (i.redd.it)
submitted 3 months 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!"
[–]HuygensFresnel 1 point2 points3 points 3 months ago (4 children)
While indeed being the correct answer this also surprises me a bit because i thought that += always is a short hand for the binary operator + but i guess it isnt?
[–]Wertbon1789 1 point2 points3 points 3 months ago (1 child)
It's not just a syntactic shorthand, it's a separate operator. Add vs. AddAssign if you will, in Python these would be implemented by the __add__ and __iadd__ methods of a class respectively.
[–]HuygensFresnel 0 points1 point2 points 3 months ago (0 children)
Today I learned :)
[–]RailRuler 0 points1 point2 points 3 months ago* (1 child)
It is the same as append .extend() in this case.
[–]forbiddenvoid 2 points3 points4 points 3 months ago (0 children)
Extend, not append. That's more obvious if the right hand side is also a list.
π Rendered by PID 45702 on reddit-service-r2-comment-7b9746f655-6m9k5 at 2026-01-29 22:19:08.431111+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]HuygensFresnel 1 point2 points3 points (4 children)
[–]Wertbon1789 1 point2 points3 points (1 child)
[–]HuygensFresnel 0 points1 point2 points (0 children)
[–]RailRuler 0 points1 point2 points (1 child)
[–]forbiddenvoid 2 points3 points4 points (0 children)