Python Naming Conventions quiz

Master Quiz: Python Naming Conventions (Full 20)

🎩 Master Quiz: Python Naming

20 Questions. Prove your DevSecOps Expertise!
Green = Correct, Red = Incorrect.

BeginnerAnalogy

In the “Dress Code” analogy, what corresponds to a “Sherwani or Suit”?

BeginnerVariable Style

What is the recommended style for my_variable_name?

IntermediateClass Naming

Which style is strictly used for Class Names?

ArchitectAutomation

Which tool in a CI/CD pipeline automates style checks?

IntermediateConstants

How should you write a constant like “API URL”?

AdvancedRefactoring

Refactor employeeID to standard Python style.

IntermediateAnti-Patterns

Why avoid Hungarian Notation (e.g., strName)?

BeginnerDescriptive Naming

Which name follows the “Meaning Rule” best?

AdvancedLegacy Code

When might you be forced to use camelCase?

ArchitectSingle Letter Vars

When are variables like x or i acceptable?

AdvancedPackage Naming

What is the convention for Package names?

AdvancedExceptions

How should you name a custom Exception?

ArchitectProtected Members

What does a single underscore prefix (_var) mean?

ArchitectName Mangling

What happens with double underscores (__var)?

IntermediateKeyword Conflicts

How do you name a variable if it conflicts with a keyword (e.g., class)?

BeginnerMethod Arguments

What is the first argument of an instance method?

IntermediateClass Methods

What is the first argument of a @classmethod?

AdvancedWhitespace

Which assignment follows PEP 8 whitespace rules?

ArchitectGlobal Variables

How do you name a module-level global variable?

IntermediateImport Aliases

Which import alias is standard?

Leave a Comment

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

Scroll to Top