title: NameError: name 'User' is not defined
body: <p>When I type it into both Visual Studio Code and Jupiter, this code will not run, and I get the &quot;NameError: name 'User' is not defined&quot; error message.  Yet when I copy and paste the EXACT same code from the author's website, it runs perfectly. I've read everything I could find online and in Python 3.9 documentation and can't figure out why. Here is the code:</p>
  <p>class User():</p>
  <pre><code>&quot;&quot;&quot;Represent a simple user profile.&quot;&quot;&quot;
      
  def __init__(self, first_name, last_name, username, email, location):
      &quot;&quot;&quot;Initialize the user.&quot;&quot;&quot;
      self.first_name = first_name.title()
      self.last_name = last_name.title()
      self.username = username
      self.email = email
      self.location = location.title()
  
  def describe_user(self):
      &quot;&quot;&quot;Display a summary of the user's information.&quot;&quot;&quot;
      print(f&quot;\n{self.first_name} {self.last_name}&quot;)
      print(f&quot;  Username: {self.username}&quot;)
      print(f&quot;  Email: {self.email}&quot;)
      print(f&quot;  Location: {self.location}&quot;)
  
  def greet_user(self):
      &quot;&quot;&quot;Display a personalized greeting to the user.&quot;&quot;&quot;
      print(f&quot;\nWelcome back, {self.username}!&quot;)
  john = User('john', 'bassett', 'Jack', 'jack@me.com', 'L.A.')
  john.describe_user()
  john.greet_user
  </code></pre>