I'm making a login system using functions in Python. I want to implement something that can search for a word in a text file (in Python), so I could verify if the inputted data is correct or not. Here is my code:
def have_an_account():
print("Then let's log in!")
user_username = input("username:")
user_password = input("password:")
with open("textfile loginsys", "r") as f:
pass
Here, after with open("textfile loginsys", "r") as f:
I want to add something that search in the file if the inputted data is found back or not.
I have tried a for-loop and using readlines(), but without success.