KnowledgeBoat Logo
|

Computer Applications

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

Python Funda

3 Likes

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.

Answered By

2 Likes


Related Questions