98.1k views
2 votes
Which of the following Python variable name follows Python variable naming conventions described in the lesson? A. unit_price B. unitpVariVrice C. Unit_Price D. xyz

User Bksunday
by
4.0k points

2 Answers

4 votes

Answer:

unit_price

Step-by-step explanation:

Variables should be named using lowercase letters as opposed to classes. Camel case names work very fine but aren't a convention in naming variables in Python. Under scores are pretty and are advised for long words that are separated such as they appear as phrases. Python variable names should however make sense such as xyz in the options which is a "no no" for variable names as it could make it difficult to understand code in the future.

User Krayzk
by
4.3k points
2 votes

Answer:

Option A and option C

Step-by-step explanation:

Variable names in python consist of upper and lower case letters, digits and under score character and variable names can never start with a number.

User Dshgna
by
3.7k points