Single and Double Underscores in Python Names Quiz

Interactive Quiz ⋅ 9 Questions
By Leodanis Pozo Ramos

In this quiz, you’ll test your understanding of Single and Double Underscores in Python Names.

By working through this quiz, you’ll revisit Python naming conventions that rely on using underscores (_), how to differentiate public and non-public names by using a single leading underscore, how to use double leading underscores to leverage name mangling in Python classes, and other common uses of underscores in Python names.

The quiz contains 9 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The maximum score is 100%. Good luck!

Related Resources

Tutorial

Single and Double Underscores in Python Names

In this tutorial, you'll learn a few Python naming conventions involving single and double underscores (_). You'll learn how to use this character to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more.

intermediate best-practices python