Single Choice Not Set

QWhich of the below claims about variable names in Python is true?

ID: #4824 Python Basic MCQ 233 views
Question Info
#4824Q ID
Not SetDifficulty
Python Basic MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A All variable names must begin with an underscore.
  • B Unlimited length
  • C The variable name length is a maximum of 2.
  • D All of the above
Correct Answer

Explanation

In Python, there is no limit on the length of variable names. You can use a variable name of any length as long as it follows the rules for naming variables in Python.
Here are the rules for naming variables in Python:

Variable names can only contain letters, digits, and underscores.
They can start with a letter or an underscore, but not with a digit.
Variable names are case-sensitive.
For example, foo and Foo are different variables.
Variable names cannot be the same as any of the Python keywords.

Share This Question

Challenge a friend or share with your study group.