title: My project keeps logging me out, Why is this happening? (CLOSED)
body: <p>I'm writing a code that will allow me to save my data into the database. But for some reason, whenever I type in a response, it refers to the else statement and logs me out.</p>
  <p>Here's my code:</p>
  <pre><code>username = &quot;storagei&quot;
  password = &quot;something&quot;
  
  # asking for a username and password.
  userInput = input(&quot;welcome back to safespace! Please type in your username to access your data.\n&quot;)
  
  
  if userInput == username:
      userInput = input(&quot;Password?\n&quot;)   
      if userInput == password:
         print(&quot;Welcome back to safespace Izzy!&quot;)
          
      else:
         print(&quot;That is the wrong password. Please try again.&quot;)
         exit(1)
  else:
      print(&quot;There is no username that matches what your responce. Please try again.&quot;)
      exit(2)
  
  print &quot;You can open_storage, add_to_storage, or log_out&quot;   
  userInput = input(&quot;What would you like to do?\n&quot;)
  
  log_out = &quot;Thanks for using safespace. Come back soon!&quot;
  open_storage = &quot;opening files.&quot;
  add_to_storage = &quot;what do you like to add?&quot;
  
  if userInput == log_out:
     print(&quot;Thanks for using safespace. Come back soon!&quot;)
     exit(3)
     if userInput == open_storage:
        print(&quot;opening storage. Please wait...&quot;)
     if userInput == add_to_storage:
        print(&quot;what would you like to add?&quot;)
  else:
      print(&quot;not a valid input. Logging you out.&quot;)
  
  </code></pre>
  <p>So for some reason, when it gets to this part of the code:</p>
  <pre><code>
  print &quot;You can open_storage, add_to_storage, or log_out&quot;   
  userInput = input(&quot;What would you like to do?\n&quot;)
  
  log_out = &quot;Thanks for using safespace. Come back soon!&quot;
  open_storage = &quot;opening files.&quot;
  add_to_storage = &quot;what do you like to add?&quot;
  
  if userInput == log_out:
     print(&quot;Thanks for using safespace. Come back soon!&quot;)
     exit(3)
     if userInput == open_storage:
        print(&quot;opening storage. Please wait...&quot;)
     if userInput == add_to_storage:
        print(&quot;what would you like to add?&quot;)
  else:
      print(&quot;not a valid input. Logging you out.&quot;)
  
  </code></pre>
  <p>I have fixed my code on my own. Here is the working script I have with all the edits if you would like to see them.</p>
  <pre><code>username = &quot;storagei&quot;
  password = &quot;something&quot;
  
  # asking for a username and password.
  userInput = input(&quot;welcome back to safespace! Please type in your username to access your data.\n&quot;)
  
  
  if userInput == username:
      userInput = input(&quot;Password?\n&quot;)   
      if userInput == password:
         print(&quot;Welcome back to safespace Izzy!&quot;)
          
      else:
         print(&quot;That is the wrong password. Please try again.&quot;)
         exit(1)
  else:
      print(&quot;There is no username that matches what your responce. Please try again.&quot;)
      exit(2)
  
  print &quot;You can open_storage type in o. add_to_storage type in a. log_out type in l. delete_files type in d. or edit_files type in e.&quot;   
  userInput = input(&quot;What would you like to do?\n&quot;)
  
  l = &quot;l&quot;
  o = &quot;o&quot;
  a = &quot;a&quot;
  d = &quot;d&quot;
  e = &quot;e&quot;
  
  if userInput == l:
     print(&quot;Thanks for using safespace. Come back soon!&quot;)
     exit(3)
  if userInput == o:
        print(&quot;opening storage. Please wait...&quot;)
  if userInput == a:
        print(&quot;what would you like to add?&quot;)
  if userInput == d:
        print(&quot;what file do you want to delete?&quot;)
  if userInput == e:
        print(&quot;what file do you want to edit?&quot;)
      
  else:
    if userInput != l:
      if userInput != o:
        if userInput != a:
          if userInput != d:
            if userInput != e:
               print(&quot;not a valid input. Logging you out.&quot;)
  
  </code></pre>