Quiz Catalog

Catalog of quizzes

class MyContainer:
  def __init__(self):
    self.items = [1, 2]

  def __contains__(self, item):
    return item in self.items

my_container = MyContainer()  
print(1 in my_container)
True
  • class/method/contains