I am doing a project for school - and as part of it, I need to check if their username is already stored within a text file:
def checkUsername():
userName = str(input("WHAT IS YOUR NAME?"))
if userName in usernames.read():
print("WELCOME BACK" + userName)
print("LET\'S GET STARTED")
return False
else:
usernames.write(userName)
print("WELCOME TO THE SYSTEM!")
return False
Despite my efforts to resolve this issue, I cannot seem to figure it out. Can anyone help?
ifandelsebranchesreturn False?