# open a file for reading file_object = open("security.txt", "r") # read in all data as one long String alldata = file_object.read() # split data at line break # because we know that's how it was stored data_split = alldata.split("\n") # store username and password as variables username = data_split[0] password = data_split[1] # ask user for potential username and password uname = input("What is your username?") pword = input("What is your password?") # check if they match if uname == username and pword == password: print("Congrats, you can continue!") else: print("Sorry, username and password don't match") # close the file myvar.close()