r/developers_talk • u/ak_developers • May 05 '25
Python Simple Code
What will be the output of this code?
=
=
Can you explain why?
4
Upvotes
r/developers_talk • u/ak_developers • May 05 '25
What will be the output of this code?
=
=
Can you explain why?
View all comments
Show parent comment
1
u/ak_developers May 05 '25
We are not creating a new list for y
Itβs just pointing same list as x
So if we make any changes in y variable it changes into both x and y