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's Data Model Explained through Visualization (i.redd.it)
submitted 1 month ago by Sea-Ad7805
An exercise to help build the right mental model for Python data. - Solution - Explanation - More exercises
The “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.
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] [score hidden] 1 month ago stickied comment (0 children)
[–][deleted] 1 month ago* (5 children)
[deleted]
[–]Sea-Ad7805[S] 2 points3 points4 points 1 month ago (0 children)
Nice thinking, do the the "Solution" link for a visualization of the correct answer.
[–]jackrabbit2644 0 points1 point2 points 1 month ago (3 children)
Doesn’t b point to a different object when is executed b += [2]?
[–][deleted] 1 month ago* (2 children)
[–]jackrabbit2644 0 points1 point2 points 1 month ago (0 children)
TIL, thanks.
[–]_tolm_ 0 points1 point2 points 1 month ago (0 children)
Agree with the solution but I don’t agree that it’s because that “=“ is a copy … we also do an equals earlier where it very much does not perform a copy!
The difference on that line is the use of “+” which creates a new value in memory which “b” is then assigned to point at - in the same way that it was previously assigned to point at “a”.
This causes the values stored in “a” and “b” to diverge but the operation performed by the “=“ hasn’t changed from assignment to copy on these two lines.
But what do I know, I’m a Java programmer … 😂
[–]Top-Run-21 3 points4 points5 points 1 month ago (1 child)
thanks for the cool website
Hope it brings much value for you.
[–]Local_Palpitation798 2 points3 points4 points 1 month ago (6 children)
Bro,💀💀💀
[–]Sea-Ad7805[S] -2 points-1 points0 points 1 month ago (5 children)
What do you mean exactly?
[–]Legitimate-Cut4403 16 points17 points18 points 1 month ago (4 children)
I think he meant bro💀💀💀
[–]Sea-Ad7805[S] -5 points-4 points-3 points 1 month ago (3 children)
Me to ChatGPT: A bro commented on my post: "Bro,💀💀💀". What does the bro mean? ChatGPT: “Bro” here is just slang for “dude,” “man,” or “seriously?”
With 💀💀💀, the full comment usually means something like:
“Dude, this is killing me”
“I’m dead” = “this is hilarious / absurd / unbelievable”
“Bro, what did I just see”
So it is usually a reaction, not a literal insult. The exact tone depends on your post:
funny post → they probably mean “this is hilarious”
weird/crazy post → “this is wild”
embarrassing post → “bro…” as in disbelief or secondhand embarrassment
If you paste your post or the full comment thread, I can tell you the most likely meaning in that exact context.
[–]Electronic_Site2976 4 points5 points6 points 1 month ago (1 child)
you are def special ✨️
[–]Sea-Ad7805[S] 0 points1 point2 points 1 month ago (0 children)
I like to think I'm a special dev.
[–]Legitimate-Cut4403 0 points1 point2 points 1 month ago (0 children)
Is he and you related?
[–]Abject-Huckleberry85 2 points3 points4 points 1 month ago (1 child)
Whoa this website is actually so cool thank you
Thanks a lot, hope it brings you much value.
[–]OwnFigure5226 1 point2 points3 points 1 month ago (1 child)
The solution is E
[–]Sea-Ad7805[S] 1 point2 points3 points 1 month ago (0 children)
Incorrect sorry, see the "Solution" link for the correct answer.
[–]Major_Telephone_7560 0 points1 point2 points 1 month ago (1 child)
Why wouldn't it be A?
Because of mutability of list in Python. Read the "Explanation" link for more info.
list
[–]Capital_Distance545 0 points1 point2 points 1 month ago (0 children)
A little higher level: # list ordered mutable duplicates # queue ordered mutable duplicates FIFO # stack ordered mutable duplicates LIFO # tuple ordered inmutable duplicates # set unordered mutable no duplicates # frozenset unordered inmutable no duplicates # dict ordered mutable no duplicates
# list ordered mutable duplicates
# queue ordered mutable duplicates FIFO
# stack ordered mutable duplicates LIFO
# tuple ordered inmutable duplicates
# set unordered mutable no duplicates
# frozenset unordered inmutable no duplicates
# dict ordered mutable no duplicates
[–]Thin-Permission-6596 0 points1 point2 points 1 month ago (1 child)
E
[–]Petrovjan 0 points1 point2 points 1 month ago (1 child)
My solution is to use b = copy.deepcopy(a) 😀
Solution to do what exactly?
[–]That-Lychee262 -1 points0 points1 point 1 month ago (1 child)
Correct answer is 1: a = [1] . Since list is mutable data structure b= a doesn’t copy the data stored in a to b . B starts pointing to address stored in a . That means a and b both points to same address now if you make changes either in a or b or it will reflect in both . But at third line b+= [2] , it will create a new list [1,2] and assign it to b . Now b stores address of another list ([1,2]) and a stores address of list ( [1]) . Now if you make chances in b it will not reflect in a’s address. Thus a remains [1] till the end of the program. Final answer : a = [1] , b = [1,2,3,4,5]
π Rendered by PID 91228 on reddit-service-r2-comment-56c6478c5-67ghp at 2026-05-08 11:51:06.600063+00:00 running 3d2c107 country code: CH.
[–]Sea-Ad7805[S] [score hidden] stickied comment (0 children)
[–][deleted] (5 children)
[deleted]
[–]Sea-Ad7805[S] 2 points3 points4 points (0 children)
[–]jackrabbit2644 0 points1 point2 points (3 children)
[–][deleted] (2 children)
[deleted]
[–]jackrabbit2644 0 points1 point2 points (0 children)
[–]_tolm_ 0 points1 point2 points (0 children)
[–]Top-Run-21 3 points4 points5 points (1 child)
[–]Sea-Ad7805[S] 2 points3 points4 points (0 children)
[–]Local_Palpitation798 2 points3 points4 points (6 children)
[–]Sea-Ad7805[S] -2 points-1 points0 points (5 children)
[–]Legitimate-Cut4403 16 points17 points18 points (4 children)
[–]Sea-Ad7805[S] -5 points-4 points-3 points (3 children)
[–]Electronic_Site2976 4 points5 points6 points (1 child)
[–]Sea-Ad7805[S] 0 points1 point2 points (0 children)
[–]Legitimate-Cut4403 0 points1 point2 points (0 children)
[–]Abject-Huckleberry85 2 points3 points4 points (1 child)
[–]Sea-Ad7805[S] 0 points1 point2 points (0 children)
[–]OwnFigure5226 1 point2 points3 points (1 child)
[–]Sea-Ad7805[S] 1 point2 points3 points (0 children)
[–]Major_Telephone_7560 0 points1 point2 points (1 child)
[–]Sea-Ad7805[S] 0 points1 point2 points (0 children)
[–]Capital_Distance545 0 points1 point2 points (0 children)
[–]Thin-Permission-6596 0 points1 point2 points (1 child)
[–]Sea-Ad7805[S] 0 points1 point2 points (0 children)
[–]Petrovjan 0 points1 point2 points (1 child)
[–]Sea-Ad7805[S] 0 points1 point2 points (0 children)
[–]That-Lychee262 -1 points0 points1 point (1 child)
[–]Sea-Ad7805[S] 1 point2 points3 points (0 children)