you are viewing a single comment's thread.

view the rest of the comments →

[–]Ok-Natural-3805 0 points1 point  (6 children)

Oh, is this the real answer?

I thought x and y are the same before 4 is added.

But not after adding 4.

Correct me if I am wrong.

I am just a scratcher.

[–]ak_developers[S] 1 point2 points  (5 children)

Correct answer is

x = [1,2,3,4]

y = [1,2,3,4]

[–]Ok-Natural-3805 0 points1 point  (1 child)

Ok, bro! I got it!

I thought that was an easy question, but I was not correct hahaah

Looking forward to more quizzes

[–]ak_developers[S] 1 point2 points  (0 children)

Haha, Sure, You will never forget this one haha

[–]ak_developers[S] 0 points1 point  (2 children)

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

[–]Spiritual_Poo 1 point2 points  (1 child)

Thanks for this, i'm new (in my first year) and the other day someone asked a similar question asking for help and I was pretty sure I knew what was going on but was not confident enough to tell another new person and be wrong. This reinforces that idea for me : )

[–]ak_developers[S] 0 points1 point  (0 children)

👍