Can someone explain this if self.cards condition? When will it be True and when will it be False?
def __init__(self):
self.cards = []
def __str__(self):
if self.cards:
rep = ""
for card in self.cards:
rep += str(card) + " "
else:
rep = "<empty>"
return rep
See Question&Answers more detail:os