So I have this function that will tell me if my argument is a tuple with 3 tuples in it, each of them with 3 digits.
so I'm using a lot of ifs, isinstances and for to do it, something like this:
def f(x):
if isinstance(x, tuple) and len(x) == 3:
____for item in x:
________if isinstance(item, tuple) and len(item) == 3:
______________for i in item:
___________________(code to check check values)
_________________________return True
This however is not working ecause I believe the code isn't going over all items and after the first i from the first item, if it checks out it just returns True. Is this the problem?
so I'm using a lot of ifs, isinstances and for to do it, something like this:
def f(x):
if isinstance(x, tuple) and len(x) == 3:
____for item in x:
________if isinstance(item, tuple) and len(item) == 3:
______________for i in item:
___________________(code to check check values)
_________________________return True
This however is not working ecause I believe the code isn't going over all items and after the first i from the first item, if it checks out it just returns True. Is this the problem?