title: How to verify username and password from CSV file in Python?
body: <p>I am doing a Python project where I have to verify my username and password from a csv file where the first two rows and columns have the username and password as 'hi'.</p>
  
  <p>Current Code: </p>
  
  <pre><code>    answer = input("Do you have an account?(yes or no) ")
  if answer == 'yes' :
     login = False
     csvfile = open("Username password.csv","r")
     reader = csv.reader('Username password.csv')
     username = input("Player One Username: ")
     password = input("Player One Password: ")
     for row in reader:
          if row[0]== username and row[1] == password:
             login = True
          else:
             login = False
     if login == False:
        print("Incorrect. Game Over.")
        exit()
     else:
        print("You are now logged in!")
  else:
     print('Only Valid Usernames can play. Game Over.')
     exit()
  </code></pre>
  
  <p>CSV file : <a href="https://thecompton-my.sharepoint.com/:x:/g/personal/001422_thecompton_org_uk/EbhI4A12pg1EhMezOR8tOlgBF-iOh8JTAM3x3WUOk3i9Ig?e=AJktHi" rel="nofollow noreferrer">https://thecompton-my.sharepoint.com/:x:/g/personal/001422_thecompton_org_uk/EbhI4A12pg1EhMezOR8tOlgBF-iOh8JTAM3x3WUOk3i9Ig?e=AJktHi</a></p>