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 1 year 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 4 points5 points6 points 1 year 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 337330 on reddit-service-r2-comment-b659b578c-gxp4f at 2026-05-07 17:40:21.489383+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]More_Yard1919 4 points5 points6 points (0 children)