1. 学习
  2. /
  3. 课程
  4. /
  5. Intermediate Python for Developers

Connected

练习

Avoiding errors

In the video, you saw a couple of approaches for error handling that can be applied to custom functions.

In this exercise, you'll test out one of the approaches that avoids raising an error, printing a helpful message if an error occurs, but not terminating the script.

说明

100 XP
  • Use a keyword allowing you to attempt to run code that cleans text.
  • Use another keyword that prints a helpful message if an error occurs when calling the clean_text() function.