Menu
Coddy logo textTech

Register

Lesson 4 of 8 in Coddy's Register Login System Project course.

challenge icon

Challenge

Easy

To 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()

All lessons in Register Login System Project

1Starting from scratch

IntroductionHow to use a set

2Building the system

InitializingRegisterProject lessonLoginProject lessonSign outProject lesson