Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- userinformation={} # creates an empty dictionary
- check= int(input("Do you alrady have an account? 0 if yes and 1 if no: ")) #user chooses if he has an account already
- if check== 0: # if user says yes then he can login
- username=input("Type in Your username: ") # User types in a username
- password= input("Type in Your password: ") # user types in a password
- if username or password in userinformation: #checks if the username is already in the dictionary
- print("Username or password already taken please choose another one") #if so then:
- else:
- userinformation[username]=password
- print(userinformation) #else the programm will safe the user inputs and print them out
- elif check==1:
- print("please register: ") # if user says "no" then he must register
- username=input("Type in a username: ")
- password=input("Type in a passwsord: ")
- userinformation[username]=password #username and password will be saved
- print (userinformation) #and printed
- elif check==2:
- print(userinformation) # secret input to print all user who have registered
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement