State True or False

"An identifier in Python can start with a digit, but not with an underscore."

Answer:

Answer by student

False

Detailed answer by teachoo

  • An identifier is a name given to a variable, function, class, module or any other object in Python.
  • An identifier can start with an underscore (_) or a letter, but not with a digit.
  • For example, _name, name, and name_1 are valid identifiers, but 1_name and name-1 are not.
  • An underscore at the beginning of an identifier has a special meaning in Python. It indicates that the identifier is private or protected and should not be accessed from outside the class or module.
  • For example, _name is a private variable and name is a special variable that holds the name of the module.
  • Therefore, the statement “An identifier in Python can start with a digit, but not with an underscore.” is false.

So, the correct answer is False.

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.