Assertion (A): To handle a file's encoding format in Python, one must specify the encoding type during the file opening process.
Reason (R): Specifying the encoding type ensures that Python correctly interprets the contents of the file, preventing issues like UnicodeDecodeError when reading.
Choose the correct option:
1
Both A and R are true, and R is the correct explanation of A.
2
Both A and R are true, but R is not the correct explanation of A.
3
A is true, but R is false.
4
A is false, but R is true.