Post

Python Programming
Python Programming@PythonPr·
90% of the beginners answer this wrongly😬🤯 Comment your answer 👇
Python Programming tweet media
English
13
3
51
6.9K
Lisa Bright
Lisa Bright@LisaBrightthe·
@PythonPr b = a Links to the same value in the memory b = a.copy() Creates a new set of valves in the memory
English
1
0
7
187
Prajwal Mohite
Prajwal Mohite@prajwalmohite18·
@PythonPr In 1st case the pointer points to object 'a', so that any changes made in 'a' will reflect in object 'b'. In 2nd case the replica of object 'a' has been created, so no more connection between 'a' and 'b', any changes made in the object 'a' will no longer affect the object 'b'.
English
0
0
1
52
Md Samsuzzoha (Shayon)
@PythonPr 1. Reference:pointing to the same memory 2. Deep copy: pointing to different values in the memory
Dhaka, Bangladesh 🇧🇩 English
0
0
1
186
Supermicro
Supermicro@Supermicro·
How do you scale from a single server to a massive AI cluster? Supermicro In-Rack Solutions integrate liquid cooling, high-performance networking, power delivery, and battery backup to support rack density, thermal efficiency, and resilient AI infrastructure.
English
13
38
409
3.7M
Jimmy Fikes
Jimmy Fikes@akajim·
@PythonPr The copy method creates a shallow copy of the list. A new object in memory is created.
English
0
0
1
178
Oluwatimilehin Gbolahan
Oluwatimilehin Gbolahan@Abrahams_77·
@PythonPr case 1: a is the same as b meaning a change in a affects b case 2: exact replica but a change in a doesn't affect b
English
0
0
0
198
Augmenta Blake
Augmenta Blake@RoboIntellect·
@PythonPr Reference vs shallow copy. But copy() is still shallow. Nested mutables remain shared references. The gotchas have layers.
English
0
0
0
426
Rishav Tiwari
Rishav Tiwari@RishavTiwari510·
@PythonPr In simple terms: 1st is person just different name to call out 2nd is shadow clone jutsu 🤣
English
0
0
0
237
Arjun Ganesh
Arjun Ganesh@iarjunganesh·
@PythonPr 1. assignment op never makes a copy, it still refers to the original object 2. copy/deepcopy ops only changes new assignment
English
0
0
0
203
akhilesh kumar ojha
akhilesh kumar ojha@kumarakh·
@PythonPr fundamental concept in Python: Reference vs. Value b=a(Reference Assignment) They are two names for the same thing b = a.copy() In this case, .copy() creates a new,independent list object in memory and assigns it to b. b is a separate object that contain the same values as a.
English
0
0
0
240
Ankit Aggarwal
Ankit Aggarwal@TechAheadAnkit·
In the top section when we copy a to b it also copied reference so any change in either of these will reflect in both. id(a) = id(b) In the second section, it actually copy only value from a to b and creates a new reference, hence any change in either a or b will not reflect in each other id(a) ≠ id(b)
English
0
0
1
174
kenz
kenz@kenz4Reall·
@PythonPr Pass by reference, pass by value
English
1
0
1
74
Grok
Grok@grok·
From deep questions to stunning visuals - Grok does it all. Sign up and start imagining instantly.
English
0
388
4.4K
20.8M
Biel Men
Biel Men@BielMenHaha·
@PythonPr 1) refers to the same list, with another variable name. 2) copy the instance of the list class, return another, placing into another memory address. Well, it's a little more complex than it looks like, it doesn't just copy the items.
English
0
0
1
46
แชร์