CBSE Class 10 Computer Applications Question 23 of 31

Python Revision — Question 11

Back to all questions
11
Question

Question 11

What is an identifier ? What are the identifier forming rules of Python ?

Answer

Identifiers are fundamental building blocks of a program and are used as the general terminology for the names given to different parts of the program viz variables, objects, classes, functions, lists, dictionaries etc. For example, Myfile, _DS, _name_01, H34CAP etc.

The identifier forming rules of Python are:

  1. An identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores, and digits (0 to 9).
  2. Python does not allow punctuation characters such as @, $, and % within identifiers.
  3. Reserved words (keywords) must not be used as identifiers.