Tokens in Python

Token :- A token is the smallest unit of program. There are various tokens in python some of them are literals, keywords, identifiers, delimiters, operators, statements and expressions.

1. Literals

It refers to data item that have a constant value. Various type of literals are string literals, None (special literal), numeric literal and boolean literal.

2. Keyword

Python has some reserve words which have predefined meaning to its interpreter. It can’t be used as variable, mrthod or class name.

3. Identifiers

It is a name used to identify a variables, arrays and functions.

4. Variable

Variables are used as containers to store data. The data stored in a variable can be modified whenever needed.

5. Delimiters

Delimiters can be defined as a sequence of one or more character that is used to specify the boundary between separate independent region in plain text or other data streams.

6. Statements

A statements is a unit of code that python interpreter can execute.

7. Operators

Operators are used to specify operations to be performed in an expression.

Categories: News

Tagged as: