90.7k views
3 votes
Which of the following names do NOT respect the naming conventions (PEP8) for variables or constants?

_total_price
total_price
TotalPrice
totalPrice
TOTAL_PRICE

User Bender
by
7.8k points

1 Answer

4 votes

Final answer:

The names _total_price, TotalPrice, and TOTAL_PRICE do NOT respect the naming conventions (PEP8) for variables or constants.

Step-by-step explanation:

The following names do NOT respect the naming conventions (PEP8) for variables or constants:

  • _total_price
  • TotalPrice
  • TOTAL_PRICE

According to PEP8, variable names should be in lowercase, with words separated by underscores, while constant names should be in uppercase, with words also separated by underscores. Therefore, the names total_price, TotalPricetotalPrice, and totalPrice respect the naming convention.

User Luketorjussen
by
7.6k points