5.8k views
3 votes
Mark and John are developing a program using Python. They name a variable 24_hour_mart, but then recognize that this name violates a Python naming convention. What naming convention does it violate?

Variable names can not include the underscore character (_).
Variable names can not begin with a number.
Variable names can not exceed ten characters in length.
Variable names can not be fewer than fifteen characters in length.

User Vjardel
by
5.1k points

2 Answers

0 votes

on edge it is option 2 or b

User TDP
by
5.5k points
3 votes

Answer:

Option 2: Variable names can not begin with a number.

Step-by-step explanation:

As given Mark and John named a variable as 24_hour_mart while writing a program in python.

While it is forbidden to name a variable starting with any digit, only alphabets (capital and smaller) and underscore can be the first letter of the variable name.

Moreover, by considering the other options given:

  • Variable name can include the underscore (_) between the words. It is used instead of spaces that are not allowed.
  • There is no upper limit for variable length, it can be of any reasonable length and more than 10 characters say 11 or 12 are reasonable.
  • There is no lower limit for variable length, it can be any reasonable length , even it can be of 1 character.

Variables named in python language must not be the keywords as they are reserved for other purposes.

i hope it will help you!

User Sirio
by
5.3k points