class Foo:
"""
class to represent 2D arrays
"""
def __init__(self, lst: list[list]) -> None:
self.lst = lst
a_list = [
[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 100]
]
If I want to access 10 in my variable a_list.
I type a_list[2][1]
What I am trying to do here is ...
I create an instance i.e Foo(a_list) and save it in a variable n.
So, n = Foo(a_list) is what I type.
Now, if I again want to access 10. I surely can access it by n.lst[2][1]
My question here, is there anyway I can do the same thing the following way: n[2][1] ?