For any queries you can reach us at infovistarindia@gmail.com / WhatsApp us: +919158876092

Tokens in Python

Python Tokens

Tokens in Python

A token is the small individual unit in a Python program.

  1. Keywords:
    Python has total 31 reserved keywords. Ex: in, for, if, and, finally, not, etc.
  2. Identifiers:
    A identifier in Python is used to identify a variable, function, class, module, or other objects. For example: MyClass, myClass, myclass, etc.
  3. Literals:
    Literals in Python can be determined as numbers, text, or other data that represent values to be stored in variables. Ex: age = 22, escape sequence, etc.
  4. Operators:
    It can be defined as symbols that are used to perform operations on operands. Ex: arithmetic operators [+, -, *, /, %], etc.
  5. Punctuators:
    Used to implement the grammatical and structure of a Syntax. Ex: &=, >>=, <<=, etc.