title: NameError: name 'self' is not defined - but I think I did it correctly
body: <p>I just started learning Python from scratch and now I am trying to learn classes concept and can't seem to find why my code is returning an error.</p>
  <p>Could you please teach me what I did incorrectly?</p>
  <pre><code>class User():
      &quot;&quot;&quot;A simple database with restaurant information.&quot;&quot;&quot;
  
      def __init__(self, first_name, last_name, gender, age):
          &quot;&quot;&quot;Initialize user's name, gender and age info.&quot;&quot;&quot;
          self.first_name = first_name
          self.last_name = last_name
          self.gender = gender
          self.age = age
          self.login_attempts = 0
      
      def increment_login_attempts(self):
          &quot;&quot;&quot;Increments the value of login_attempts by 1&quot;&quot;&quot;
          self.login_attempts += 1
      
      def reset_login_attempts(self):
          &quot;&quot;&quot;Resets the value of login_attempts.&quot;&quot;&quot;
          self.login_attempts = 0
      
  user3 = User('mino', 'lee', 'male', 35)
  
  print(&quot;\n&quot;)
  user3.increment_login_attempts()
  user3.increment_login_attempts()
  print(&quot;\nLogin attempted &quot; + str(self.login_attempts) + &quot; times.&quot;)
  
  user3.reset_login_attempts()
  print(&quot;\nLogin attempted &quot; + str(self.login_attempts) + &quot; times.&quot;)
  </code></pre>