Hello Everyone! A simple questions!

A

alex23

values = [0, 1, 2]
values[1] = values
values
[0, [...], 2]

why??

First, it helps if you tell us what you were expecting instead.

In your example, you have a list where you have replaced the 2nd element
with the list itself. The [...] indicates that it is self-referential;
there is no other way for it to display itself, because the contained
reference also refers to itself.
values[1] [0, [...], 2]
values[1][1] [0, [...], 2]
values[1][1][1][1][1][1][1][1][1] [0, [...], 2]
values[1][1][1][1][1][1][1][1][1] is values
True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Hello everyone 0
Hello everyone 1
Hello everyone ! 4
Hello Everyone 2
Hello Everyone. 2
Hello everyone 0
Hello everyone 0
Hello everyone! 0

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top