Challenge: User Auth
Aufgabe
Swipe to start coding
Let's improve your User class!
- Create the class attribute
is_authenticatedin theUserclass. - Define the
login()method that takes argumentsselfandtaken_password. - The
login()method should compare the user and taken passwords.
If the user password is equal to the taken password, theTrueshould be assigned to theis_authenticatedattribute.
If the user password is not equal to the taken password, the"Wrong password!"should be written in the console. - Define the
logout()methods. This method should assign theFalsevalue to theis_authenticatedinstance attribute.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 8
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Suggested prompts:
Zusammenfassen Sie dieses Kapitel
Code in file erklären
Erklären, warum file die Aufgabe nicht löst
Awesome!
Completion rate improved to 2.78
Challenge: User Auth
Swipe um das Menü anzuzeigen
Aufgabe
Swipe to start coding
Let's improve your User class!
- Create the class attribute
is_authenticatedin theUserclass. - Define the
login()method that takes argumentsselfandtaken_password. - The
login()method should compare the user and taken passwords.
If the user password is equal to the taken password, theTrueshould be assigned to theis_authenticatedattribute.
If the user password is not equal to the taken password, the"Wrong password!"should be written in the console. - Define the
logout()methods. This method should assign theFalsevalue to theis_authenticatedinstance attribute.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 8
single