title: How to check owner of an Account?
body: <p>Here is the task:</p>
  <p>Person class</p>
  <p>Attributes:</p>
  <p>person_id: int - unique number of the person in the system</p>
  <p>name: str - name of the person</p>
  <p>age: int - age of the person</p>
  <p>accounts: List [Account] - list of owned accounts (Account objects)</p>
  <p>Methods:</p>
  <p>check_integrity (self) -&gt; bool - checks integrity according to the following rules:</p>
  <pre><code>1. Bank client must be an adult (18+)
  2. The client name cannot be an empty string
  3. For each owned account in the list, the person must be set as owner (see below). If everything is as it should, it returns True, otherwise False.
  </code></pre>
  <p>Account class</p>
  <p>Attributes:</p>
  <p>account_id: int - a unique bank account number</p>
  <p>password: str - password for working with the account (in the real world it would never be stored without encryption, but it will be enough for us)</p>
  <p>balance: int - an integer account balance</p>
  <p>limit: int - an integer maximum that the balance must not exceed</p>
  <p>owner: Person - the person (Person object) who owns the account</p>
  <p>here is my programme(i need to change check intengrity function because this function is bad) and i dont know how to implement the function.</p>
  <pre><code>from typing import List
  
  class Person():
  
      def __init__(self,person_id: int,name: str,age: int, accounts: List['Account']): 
          self.person_id = person_id
          self.name = name
          self.age = age
          self.accounts = accounts
      
      def check_integrity(self):
          for v in self.accounts:
              if v.owner == Person() and self.age &gt;= 18 and self.name != '':
                  return True
              else:
                  return False
  class Account():
  
      def __init__(self,account_id: int,password: str,balance: int,limit:int,owner:Person):
          self.account_id = account_id
          self.password = password
          self.balance = balance 
          self.limit = limit 
          self.owner = owner
  </code></pre>