I´m trying to implement generator notation into my code, specifically into my str() method. This is what I have so far and now I need to add "elif" statement there, but not sure how to type it into this generator notation. Can you help?
def __str__(self):
lines = []
for sub_list in self.tab:
lines.append(' '.join([str(item) for item in sub_list if not isinstance(item, set) else '.']))
return '\n'.join(lines)