Python Documentation

(For Programmers By Programmers)

What Is Python ?

Installing Python

To install Python, you must first download the installation package of the required version (3.8.2) from the link given below https://www.python.org/downloads/. Double click the file to install it.

Features of Python

In Python, there are two modes for running code:

Interactive mode –

Pros and Cons of Script Mode :

The following are the advantages of running your code in script mode:

The following are the disadvantages of using the script mode:

Key Differences Between Interactive and Script Mode

Variables

A variable is a reserved memory location to store values.

Rules For Naming A Variable

Some invalid variables

Comments

Operators

Id()

Tokens

The smallest element of a Python program is known as Token.
Some Of The Parts Of Tokens Are As Follows:

Keywords

Keywords are the reserved words of Python that have a special fixed meaning for the interpreter.Commonly used key words are True, False, break, continue, print, import, continue etc.

Identifiers

Identifiers are names given to the variables, constant, function or module. A keyword cannot be used as an identifier.
Valid examples of indentifiers- ABC, Num_1, num1

Literals

A fixed numeric or non-numeric value is called a literal.
Examples – 2, -23.6, “MCS” , ‘Class 8’

Operators

A symbol or a word that performs some kind of operation on given values and returns the result.
Examples are: +, -, **, *

Python is case sensitive

It means you have to take care whether you are naming the variables with capital letters or small letters.