how to check if a list contains an object in python code example Example: check if object is array like python if hasattr(N, "__len__")