title: How can I have the magic `__contains__` method invoked?
body: <p>I have the contains method in my Sentence class that checks if a word is in a sentence(string in my case) </p>
  
  <p>I tried to check in my <code>functionTesting</code> if <code>hello</code> exist in <code>hello world</code> and I got this error instead:</p>
  
  <pre class="lang-none prettyprint-override"><code>AttributeError: 'Sentence' object has no attribute 'contains'
  </code></pre>
  
  <p>here is my code</p>
  
  <pre><code>class Sentence:
  
      def __init__(self, string):
          self._string = string
  
      def getSentence(self):
          return self._string
  
      def getWords(self):
          return self._string.split()
  
      def getLength(self):
          return len(self._string)
  
      def getNumWords(self):
          return len(self._string.split())
  
      def capitalize(self):
          self._string = self._string.upper()
  
      def punctation(self):
          self._string = self._string + ", "
  
      def __str__(self):
          return self._string
  
      def __getitem__(self, k):
          return k
  
      def __len__(self):
          return self._String
  
      def __getslice__(self, start, end):
          return self[max(0, i):max(0, j):]
  
      def __add__(self, other):
          self._string = self._string + other._string
          return self._string
  
      def __frequencyTable__(self):
          return 0
  
      def __contains__(self, word):
          if word in self._string:
              return True  # contains function!!##
  
  
  def functionTesting():
      hippo = Sentence("hello world")
      print(hippo.getSentence())
      print(hippo.getLength())
      print(hippo.getNumWords())
      print(hippo.getWords())
  
      hippo.capitalize()
      hippo.punctation()
  
      print(hippo.getSentence())
  
      print(hippo.contains("hello"))
  
  
  functionTesting()
  </code></pre>
  
  <p>How do you call the <code>__contains__</code> function? Did I make a mistake in the class method function or did I make a mistake in the <code>functionTesting</code> when calling it? I am expecting to get <code>True</code>.</p>