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'.
Current Code:
answer = input("Do you have an account?(yes or no) ")
if answer == 'yes' :login = Falsecsvfile = 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 = Trueelse:login = Falseif login == False:print("Incorrect. Game Over.")exit()else:print("You are now logged in!")
else:print('Only Valid Usernames can play. Game Over.')exit()
CSV file : https://thecompton-my.sharepoint.com/:x:/g/personal/001422_thecompton_org_uk/EbhI4A12pg1EhMezOR8tOlgBF-iOh8JTAM3x3WUOk3i9Ig?e=AJktHi