title: object oriented programming with tamagotchi class
body: <p>Write a class <code>Tamagotchi</code> that creates a Tamagotchi object with the specified name. You should decide what properties the <code>Tamagotchi</code> object should have in order to support the required behaviour as elaborated below. A <code>Tamagotchi</code> object, t has three methods:</p>
  
  <ul>
  <li><p><code>teach</code> where there can be a variable number of string inputs. This teaches the tamagotchi these words. Symbols will also work. If you try to teach a tamagotchi the same words more than once, it will ignore the later attempts.</p></li>
  <li><p><code>play</code> will make the tamagotchi return a stringified list of words that it has been taught (in sequential order).</p></li>
  <li><p><code>kill</code> will kill the tamagotchi. Once a tamagotchi is in heaven, it cannot be taught and will not respond when you try to play with it. Instead, all further method calls will return the string <code>"&lt;name&gt; is pining for the fjords"</code> where <code>&lt;name&gt;</code> is the name of the tamagotchi.</p></li>
  </ul>
  
  <p>This is my code:</p>
  
  <pre><code>class Tamagotchi():
      def __init__(self, name):
          self.name = name
  
      def teach(self, words):
          new_words = []
          [new_words.append(x) for x in words if x not in new_words]
          ("".join(new_words))
  
      def play(self):
          return 'meow meow says ' + Tamogotchi.teach(words)
  </code></pre>
  
  <p>Test codes:</p>
  
  <pre><code>&gt;&gt;&gt; meow_meow = Tamagotchi("meow meow")
  &gt;&gt;&gt; meow_meow.teach("meow")
  &gt;&gt;&gt; meow_meow.play()
  'meow meow says meow'
  &gt;&gt;&gt; meow_meow.teach("purr")
  &gt;&gt;&gt; meow_meow.teach("meow")
  &gt;&gt;&gt; meow_meow.play()
  'meow meow says meow and purr'
  &gt;&gt;&gt; meow_meow.kill()
  'meow_meow killed'
  &gt;&gt;&gt; meow_meow.teach("hello")
  'meow meow is pining for the fjords'
  &gt;&gt;&gt; meow_meow.play()
  'meow meow is pining for the fjords'
  </code></pre>
  
  <p>Whats wrong with my code? i didn't get the result i want for meow_meow.play()</p>