Hello All
I'm not quite sure you can do this but it seems to me like something python is probably able to do. Basically, I need to assert that somewhere in my list of lists i have a '2', and a '1'. Now my lists in the biglist are all the same length. By which i mean that len(BigList) == len(BigList[i+1] for all valid indicies i.
I was just thinking something like this:
[element for element in SmallList for SmallList in BigList]
I understand why this doesn't work, but for some reason, i'm pretty sure that it can be done in python. It just seems to cohere with the python way of doing things.
I may be wrong, but i thought i'd ask. For now i have to settle for this ugly alternative:
FlattenedList = []
for SmallList in BigList:
for element in SmallList:
FlattenedList.append(element)
assert FlattenedList.__contains__('2'), "Does not contain 2."
assert FlattenedList.__contains__('1'), "Does not contain 1."