Certified Professional in Python Programming (PCPP-32-101) — Question 33

Select the true statements related to PEP 8 programming recommendations for code writing. (Choose two.)

Answer options

Correct answer: B, D

Explanation

Option B is correct because PEP 8 recommends using isinstance() for type checking, which is more robust and supports inheritance. Option D is also correct as it highlights the issues with trailing whitespace in string literals, which can cause confusion in code readability. Options A and C are incorrect; A suggests a less readable practice and C contradicts the intention of writing portable code.