I made a User login system in which user must enter one of three alphabets that is x to stop the program, y if you are a new user and n if you are not a new user.
self.register = input('Enter y if you have register or n if you are new or x to quit:')
If user enter's 'n' then it will create a new user and store it into a dictionary:- ex:- username = Fread password = hello
{'Fread':'hello'}
From here if user enter's y then it will check if te user exist with this condition:-
self.existing_Id = input('Please enter your existing id here:')
self.existing_Password = input('Please enter your existing password here:')
if self.existing_Id in self.save and self.save[self.id] == self.password:
print('you have successfully logged in')
else:
print('user not found please try again')
Also if the user already exist then it will also not create a user:-
while True:
self.id = input('please enter your ID here:')
if self.id in self.save:
print('User already exist!!!')
break
Here i am trying to save all the username and password into file then everytime i stop and rerun te code again it should load all the previous saved file into a dictionary?