Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Safely Auth | Error Handling
Mastering Python: Annotations, Errors and Environment
course content

Зміст курсу

Mastering Python: Annotations, Errors and Environment

Challenge: Safely Auth

Note

These comments help you find the code that needs to be modified:
========== Modify code below ==========
========== Modify code above ==========

Завдання

You have implemented the login() function, which raises errors. Implement the safely_auth() function that uses the login() function and catches errors.

  1. Create a code block to track errors (mention the keyword).
  2. Call the login() function in the error tracking block.
  3. Catch the TypeError and save its info inside the error variable.
  4. Print the error variable (error info) in the console.
  5. Catch the ValueError and save its info inside the error variable.

Завдання

You have implemented the login() function, which raises errors. Implement the safely_auth() function that uses the login() function and catches errors.

  1. Create a code block to track errors (mention the keyword).
  2. Call the login() function in the error tracking block.
  3. Catch the TypeError and save its info inside the error variable.
  4. Print the error variable (error info) in the console.
  5. Catch the ValueError and save its info inside the error variable.

Все було зрозуміло?

Секція 3. Розділ 6
toggle bottom row

Challenge: Safely Auth

Note

These comments help you find the code that needs to be modified:
========== Modify code below ==========
========== Modify code above ==========

Завдання

You have implemented the login() function, which raises errors. Implement the safely_auth() function that uses the login() function and catches errors.

  1. Create a code block to track errors (mention the keyword).
  2. Call the login() function in the error tracking block.
  3. Catch the TypeError and save its info inside the error variable.
  4. Print the error variable (error info) in the console.
  5. Catch the ValueError and save its info inside the error variable.

Завдання

You have implemented the login() function, which raises errors. Implement the safely_auth() function that uses the login() function and catches errors.

  1. Create a code block to track errors (mention the keyword).
  2. Call the login() function in the error tracking block.
  3. Catch the TypeError and save its info inside the error variable.
  4. Print the error variable (error info) in the console.
  5. Catch the ValueError and save its info inside the error variable.

Все було зрозуміло?

Секція 3. Розділ 6
toggle bottom row

Challenge: Safely Auth

Note

These comments help you find the code that needs to be modified:
========== Modify code below ==========
========== Modify code above ==========

Завдання

You have implemented the login() function, which raises errors. Implement the safely_auth() function that uses the login() function and catches errors.

  1. Create a code block to track errors (mention the keyword).
  2. Call the login() function in the error tracking block.
  3. Catch the TypeError and save its info inside the error variable.
  4. Print the error variable (error info) in the console.
  5. Catch the ValueError and save its info inside the error variable.

Завдання

You have implemented the login() function, which raises errors. Implement the safely_auth() function that uses the login() function and catches errors.

  1. Create a code block to track errors (mention the keyword).
  2. Call the login() function in the error tracking block.
  3. Catch the TypeError and save its info inside the error variable.
  4. Print the error variable (error info) in the console.
  5. Catch the ValueError and save its info inside the error variable.

Все було зрозуміло?

Note

These comments help you find the code that needs to be modified:
========== Modify code below ==========
========== Modify code above ==========

Завдання

You have implemented the login() function, which raises errors. Implement the safely_auth() function that uses the login() function and catches errors.

  1. Create a code block to track errors (mention the keyword).
  2. Call the login() function in the error tracking block.
  3. Catch the TypeError and save its info inside the error variable.
  4. Print the error variable (error info) in the console.
  5. Catch the ValueError and save its info inside the error variable.

Секція 3. Розділ 6
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt