Practice mode Python

Which naming style does PEP 8 recommend for Python class names?

Correct answer B. CapWords, for example BankAccount

Explanation

PEP 8 says class names should normally use the CapWords convention, also called CamelCase. Function and variable names use lowercase words separated by underscores, and module-level constants use UPPER_CASE. mixedCase is allowed only where it is already the prevailing style for consistency.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.