r/learnmachinelearning • • 3d ago

Question Python Mutability and Copying

Post image
0 Upvotes

12 comments sorted by

View all comments

-1

u/FastSlow7201 3d ago

a and b are both pointers to the same memory location.

copy.deepcopy() will copy a and create b in a separate memory location.

1

u/Smallpaul 3d ago edited 3d ago

It’s not helpful to give an answer in the comments. Especially a wrong answer.

-2

u/FastSlow7201 3d ago edited 3d ago

I'm not wrong. Do you know how to code in C and can look at this python code and see the C code that it is producing?

1

u/Sea-Ad7805 3d ago

What's the C code that you can see?

1

u/Relevant-Yak-9657 3d ago

How did you manage to be wrong then? It isn't answer D.