Avsnitt 3. Kapitel 6
single
Challenge: Safely Auth
Svep för att visa menyn
Note
These comments help you find the code that needs to be modified:
========== Modify code below ==========
========== Modify code above ==========
Uppgift
Swipe to start coding
You have implemented the login() function, which raises errors. Implement the safely_auth() function that uses the login() function and catches errors.
- Create a code block to track errors (mention the keyword).
- Call the
login()function in the error tracking block. - Catch the
TypeErrorand save its info inside theerrorvariable. - Print the
errorvariable (error info) in the console. - Catch the
ValueErrorand save its info inside theerrorvariable.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 3. Kapitel 6
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal