check if item is list python code example
Example 1: check if list of list python
for item in list_of_lists:
isinstance(item, list)
Example 2: check if a number is in a list python
5 in [3, 4, 5, 6, 7]
# True
9 in [3, 4, 5, 6, 7]
# False
for item in list_of_lists:
isinstance(item, list)
5 in [3, 4, 5, 6, 7]
# True
9 in [3, 4, 5, 6, 7]
# False