What is the ellipsis [...] in a Python list? -
i playing around in python. used following code in idle
p = [1, 2] p[1:1] = [p] print p
the output
[1, [...], 2]
what […]? interestingly use list of list of list upto infinity i.e.
p[1][1][1]....
i write above long wanted , still work.
edit:
- how represented in memory?
- what's use? examples of cases useful helpful.
- any link official documentation useful.
it means created infinite list nested inside itself, can not printed. p
contains p
contains p
... , on. [...]
notation way let know this, , inform can't represented! take @ @6502's answer see nice picture showing what's happening.
now, regarding 3 new items after edit:
Comments
Post a Comment