Can someone explain this if self.cards condition? When will it be True and when will it be False?
def __str__(self):
if self.cards:
rep = ""
for card in self.cards:
rep += str(card) + " "
else:
rep = "<empty>"
return rep
Aucun commentaire:
Enregistrer un commentaire