Examveda

Which of the following is true for variable names in Python?

A. underscore and ampersand are the only two special characters allowed

B. unlimited length

C. all private members must have leading and trailing underscores

D. none of the mentioned

Answer: Option B

Solution (By Examveda Team)

In Python, variable names have the following characteristics:

They can be of unlimited length, allowing for descriptive and meaningful names.
They can consist of letters (both uppercase and lowercase), digits, and underscores (_).
They cannot begin with a digit.
They are case-sensitive, meaning uppercase and lowercase letters are considered distinct.

Therefore, the correct statement for variable names in Python is that they have unlimited length.

This Question Belongs to Python Program >> Introduction To Python

Join The Discussion

Related Questions on Introduction to Python