Reputation: 2362
I want to check whether or not a list contains another list inside it. I don't care about the elements, I just want to check the existence of a nested list.
I have done this:
nested_list = False
for element_of_list in b:
if isinstance(element_of_list, list):
nested_list = True
But I was wondering if there is a more Pythonic way to do this.
Upvotes: 0
Views: 57