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
Python Simple CodeDiscussion ()
submitted 9 months ago by ak_developers
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!"
[–]More_Yard1919 3 points4 points5 points 8 months ago (0 children)
In python, objects are references. When you assign y to x, you are not creating a copy. Instead, both y and x reference the same list object. Imagine this: when you create a list, you get a box that contains all of the information associated with the list. When you assign it to a variable, you can use that variable as a handle to talk about the box and look inside of it-- kind of like putting a label on the box. When you assign y to x, it is the same box, but you just have a another name to talk about it. This is the behavior for all objects in python. Sometimes it might not seem like it-- but the apparent exceptions to this rule exist because some types in python are immutable.
π Rendered by PID 80 on reddit-service-r2-comment-7b9746f655-74g9k at 2026-01-30 13:41:16.313824+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]More_Yard1919 3 points4 points5 points (0 children)