Keywords and Identifiers in Python

Keywords are reserved words in python and they are case sensitive.
All the keywords except True, False, and None are in lowercase and they must be written as it is.

Keywords in Python programming language
False class finally is return
None continue for lambda try
True def from nonlocal while
and del global not with
as elif if or yield
assert else import pass  
break except in raise  

Identifier is the name set for entity like Class, Function, Variable etc.

Point to Remember:

  • Identifier cannot start with a digit.
    1. “1variable” is invalid identifier name.
    2. “variable1” is valid identifier name.
  • Identifiers can be a combination of
    1. letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore (_).
  • below are some valid examples of identifiers name.
    1. myclass
    2. var_1
    3. print_this_to_screen
  • Keywords of python cannot be used as identifiers name.
  • We cannot use special symbols (!, @, #, $, % etc.) in our identifier.
  • Identifiers can be of any length.

You may also like...

1 Response

  1. Tryly amazing comments you have here!

Leave a Reply

Your email address will not be published.