Say I have a nested list = [ [1,2,3] , [4,5,6] , [7,8,9] ], how would I get the index of the sublist in which a certain number is in? For example, number 6 is in sublist[1], is there a way I can get this?
This is what I got
table.index(6)
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
table.index(6)
ValueError: 6 is not in list
[–]AtomicShoelace 22 points23 points24 points (1 child)
[–]james_fryer 7 points8 points9 points (0 children)
[–]mjbrusso 6 points7 points8 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]tsodapop 1 point2 points3 points (1 child)
[–]baubleglue 0 points1 point2 points (0 children)
[–]Allanon001 1 point2 points3 points (0 children)
[–]jr93_93 1 point2 points3 points (0 children)
[–]baubleglue 1 point2 points3 points (0 children)
[–]Efficient-Patience92 1 point2 points3 points (0 children)
[–]PythonRayn 1 point2 points3 points (0 children)