3 ms·
Not the op, but I'd accept the confusion response of: [[]] [[],[]] [[],[],[]] because the behavior is the same, whether or not they misread an 'l'
by sophacles 12y ago
Not the op, but I'd accept the confusion response of:
[[]]
[[],[]]
[[],[],[]]
because the behavior is the same, whether or not they misread an 'l' as a 1.
- pyre 12y agoPython doesn't seem to agree with you :^) In [1]: a = [] In [2]: a.append(a) In [3]: a Out[3]: [[...]] In [4]: a[0] Out[4]: [[...]] In [5]: a[0][0] Out[5]: [[...]] In [6]: a[0][0][0] Out[6]: [[...]] In [7]: a[0][0][0][0] Out[7]: [[...]] In [8]: a.append(a) In [9]: a Out[9]: [[...], [...]] In [10]: a[0][1][0] is a Out[10]: True In [11]: id(a) Out[11]: 4547140064 In [12]: id(a[0][1][0]) Out[12]: 4547140064
- sophacles 12y agoYeah, the whole infinite loop thing. Wasn't fully thinking when I wrote my reply. Good catch.