Register
Lesson 4 of 8 in Coddy's Register Login System Project course.
Challenge
EasyTo allow users to register create a method register(self, username, password) that receives username and password.
All of our registered users will be stored inside the variable users that we initialized in the previous lesson. The keys are the usernames and the values are the passwords. The method will check if a user is already registered in the system, if he isn't in the system register him and print user registered successfully. If the user already registered print: user already exists
Try it yourself
class LoginSystem:
def __init__(self):
self.users = {}
self.logged_users = set()