Why not to allow tuple as a list index?

T = [[11, 12, 5, 2], [15, 6, 10], [10, 8, 12, 5], [12, 15, 8, 6]]
print(T[1][2])
10
print(T[1, 2])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: list indices must be integers or slices, not tuple

https://stackoverflow.com/questions/40361743/python-using-tuples-as-list-indices
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/DFPPECRZRQHT2WXOTYPRUHAYMYH2XQ6U/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to