title: How do you delete a specific appended dictionary (i.e. its key and value) in a list
body: <p>I have this output and want to delete a specific user dictionary but apparently, my code only deletes the last user appended to the list even after specifying what to delete. Help is much appreciated.</p>
  
  <pre><code>[{'password': '1234', 'id': 1, 'name': 'martin'}, {'password': '123',
  'id': 2, 'name': 'artin'}, {'password': '134', 'id': 3, 'name':
  'tin'}, {'password': '1234', 'id': 4, 'name': 'mart'}]
  </code></pre>
  
  <p>How do I delete <code>{'password': '123', 'id': 2, 'name': 'artin'}</code></p>
  
  <p>Here is my code:</p>
  
  <pre><code>class ClassRoom:
      def __init__(self):
          self.people= []
          self.id = 0
  
      def get_people(self):
          return self.people
  
      def add_person(self, name, password):
  
          self.id += 1
          self.user = {
                  'id': self.id,
                  'name': name,
                  'password': password,
                  }
          self.people.append(self.user)
  
      def remove_person(self, name, password):
  
          self.id -= 1
  
          if self.user in self.people:
              if self.user['name'] and self.user['password']:
                  self.user.clear()
  
  
  if __name__ == '__main__':
      room = ClassRoom()
      room.add_person('martin','1234')
      room.add_person('artin','123')
      room.add_person('tin','134')
      room.add_person('mart','1234')
  
      print("before remove", room.get_people())
  
      room.remove_person('artin', '123')
  
      print("after remove", room.get_people())
  </code></pre>