i

Python Programming

Identifiers in Python

It is name given to entities like class, functions, variable and help to identify one entity from another.

Identifiers writing rules

  • They are the both lowercase or upper case of a-z or digits 0-9 or may be underscore.

  • Below error because keywords cannot be used as identifiers. As “global” is keyword

  • global = 1

File"", line 1

global = 1

           error “invalid syntax

  • Can’t use special symbols like !@#$% etc. in our identifier.

a@ = 0

File"", line 1

a@ = 0

     ^

SyntaxError: invalid syntax