1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Intermediate Object-Oriented Programming in Python

Connected

अभ्यास

Creating a Lottery iterator

You've practiced building an iterator, and handling StopIteration exceptions when using an iterator. Now, it's time to put it all together. You'll be building a Lottery iterator to draw integers at random and create a winning number. Happy coding!

निर्देश 1/3

undefined XP
    1
    2
    3
  • Define a magic method that returns a reference to the object, making the Lottery class an iterator.