Has One Method, Not the Other
class Deck:
def __init__(self, cards):
self.cards = cards
def __iter__(self):
return iter(self.cards)
d = Deck([1, 2, 3])
next(d)
What happens when this runs?
Sign in to answer questions and track your progress
Sign In