+ 1
Checking if a list contains a sublist
If someone could please give a simple code for this one it'd be really helpful
4 Antworten
+ 1
U cant ask user to code for u
0
This is some simple code to get you started:
def contains_sublist(collection):
for item in collection: #iterate through each item
if type(item) is list: #if item in collection is a sublist
return True
return False
Hopefully you'll be able to modify it for more complex use.