22
QuizMultiple Choice

Use Data Structures — Cumulative exam

Question 22 • Introduction to Information Technology - EL3701

Which argument forces a writer to return to and change the input before resolving a “UnicodeError”?

Answer
A
errors= “strict”
B
errors= “fix”
C
errors= “ignore”
D
errors= “replace”

Explanation

With errors="strict", Python raises a UnicodeError when it encounters text it cannot encode or decode. The writer must correct the input and try again; the other standard handlers, such as "ignore" and "replace," instead continue by skipping or substituting problematic characters. The correct choice is “errors="strict".”

AI-written and checked against the verified answer.

Previous
Next