GIAC Python Coder (GPYC) — Question 16
A user enters unexpected data into program. Which functionality can the programmer use to present an understandable error message to the user?
Answer options
- A. Casting
- B. Exception handling
- C. Dictionaries
- D. Regular expressions
Correct answer: B
Explanation
Exception handling is the correct answer because it allows programmers to manage errors gracefully and present user-friendly messages when unexpected data inputs occur. The other options, such as casting, dictionaries, and regular expressions, do not specifically address error management and user communication in this context.