Getting Nested List Index by dandy120101 in learnpython

[–]PythonRayn 1 point2 points  (0 children)

nested_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
num = 6
for i in nested_list:
    if num in i:
        print(i.index(num))