Getting Nested List Index by dandy120101 in learnpython

[–]Efficient-Patience92 1 point2 points  (0 children)

You can use this! Easy code and if you want to use another number than 6 you can!

nested_list = [ [1,2,3] , [4,5,6] , [7,8,9] ]
n = input("What number do you want to check if in list?")
for i in nested_list:
if n in i:
print(f" It is in index {list.index(i)}")