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 1
Hello everyone 0
Hello everyone 1
Hello Everyone 1
Hello everyone ! 4
Hello Everyone! 3
Hello everyone! 5
Hello Everyone 2

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top