Create 7 - Searching a Nested List.py

This commit is contained in:
Lukas Baumann 2021-02-17 14:06:33 +01:00 committed by GitHub
parent 039811ac74
commit 911e5a3bd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,9 @@
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