1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Python for Developers

Connected

Exercise

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.

Instructions

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.