Question: Why is the following program incorrect given that the user wants print ( b ) to display: [ 4 , 5 , [ 1 ,
Why is the following program incorrect given that the user wants printb to display:
a
b a
ad
printb
Python
is a copy of list a In other words, list b only contains a copy to list a
Any changes to list a will be reflected in list since bs entry for list is a copy of
the original list.
uses a pointer to reference the list In other words, list b only contains
a pointer to list Any changes to list a will be reflected in list since bs entry
for list a points to the original list.
This is impossible. There does not exist a programming technique, in Python, to
do what the programmers wants to accomplish.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
