title: How do i make this python login/register program work? (I am new to python)
body: <p><strong>So i am quite new to python</strong> (knew C# before trying to learn python) and i wanted to make an <strong>little login/register program</strong>, i wrote it all, theorically (at least to me) it would work, but it doesn´t, it doesn´t logs indenpendently of that account existing or not...</p>
  
  <p><strong>How do i make this program work?</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>command = ""
  username = ""
  password = ""
  
  def Register():
      global username
      global password
      username = input("Username: ")
      password = input("Password: ")
  
      f = open("userinfo.txt", "a")
      f.write("--------------------")
      f.write("\n%s information:\n"%(username))
      f.write("%s \n"%(username))
      f.write("%s \n"%(password))
      f.write("--------------------")
  
  def Login():
      global username
      global password
      f = open("userinfo.txt", "r")
      f.readline()
      f.readline()
      username = f.readline()
      password = f.readline()
      f.readline()
      return username
      return password
  
  def CheckLogin():
      global username
      global password
      global loginusername
      global loginpassword
  
      if loginusername == username and loginpassword == password:
          print("You´ve logged in, wait for next updates")
  
      elif loginusername == username and loginpassword != password:
          print("Wrong password")
  
      elif loginusername != username and loginpassword == password:
          print("Wrong username")
  
      elif loginusername != username and loginpassword != password:
          print("Wrong login information, restart the program and register to create an account")
  
      else:
          print("ERROR: Uknown error")
  
  
  command = input("Would you like to login or register?\n")
  if (command == "register"):
      Register()
      print("Done!")
  
  elif (command == "login"):
      print("--------LOGIN--------")
      loginusername = input("Username: ")
      loginpassword = input("Password: ")
      Login()
      CheckLogin()
  
  
  
  else:
      print("Invalid command")
      print("Please restart the program and try again")
  </code></pre>
  
  <p>So, do i need to make class related stuff?
  like, users being objects?
  but how would i save that data?</p>
  
  <p><strong>Please help me</strong></p>
  
  <p>Edit: did some minor polishing on the code, fixed an error but now i have other...</p>