csc-python-solutions/16/7 - Searching a Nested List.py

10 lines
219 B
Python
Raw Normal View History

2021-02-17 13:06:33 +00:00
def nestedListContains(NL, target):
if isinstance(NL, int):
if NL == target:
return True
return False
for i in NL:
if nestedListContains(i, target):
return True
return False