title: Python Object Oriented Programming basic login system returns TypeError
body: <p>I was trying to make a basic login system that can log in or register the user and store the info in a text file. Yet, as a beginner, I'm facing a problem to which I couldn't find any solution.</p>
  
  <p>So I defined my class and functions that I want to make:</p>
  
  <pre class="lang-py prettyprint-override"><code>class User():
      def __init__(self, username, password, email):
          self.username = username
          self.password = password
          self.email = email
  
      def login(self, username, password):
          self.username = input("Enter username: ")
          self.password = input("Enter password: ")
          with open("register.txt", "r", encoding=utf-8) as file:
              if username == username and password == password:
                  print("login successful!")
  
      def register(self, username, password, email):
          self.username = input("Enter username: ")
          self.password = input("Enter password: ")
          self.pass_check = input("Enter password: ")
          self.email = input("Enter email: ")
  
          if password == pass_check:
              print("Password match, you can login")
              with open("register.txt", "a", encoding=utf-8) as file:
                  file.write('Username:', username+' ', 'Password:',
                             password+' ', 'email:', email)
          else:
              print("passwords don't match")
  </code></pre>
  
  <p>Secondly added a simple code for using these functions:</p>
  
  <pre class="lang-py prettyprint-override"><code>choice = int(input("1-Login  2-Register"))
  if choice == 1:
      User.login()
  elif choice == 2:
      User.register()
  </code></pre>
  
  <p>When i run this code i get this error:</p>
  
  <pre class="lang-py prettyprint-override"><code>Traceback(most recent call last):
    File "c:/Users/ASUS/Desktop/Python Projects/login-oop.py", line 32, in &lt;module &gt; User.login()
  TypeError: login() missing 3 required positional arguments: 'self', 'username', and 'password'
  </code></pre>
  
  <p>I searched for hours and I think it's very fundamental but I couldn't find any solution.</p>