Getting Started
with Python
Introduction
Program - A Set of instructions written in a sequence to
perform a particular task.
Software – A set of logically related programs.
The process of writing a program is programming.
A programming language is set of grammatical rules for
instructing a computer or computing device to perform
specific tasks. It is a means of giving instructions to the
computer.
e.g. C, C++, COBOL, Java, FORTRAN, Python
Python Programming Language
Python is easy, simple and highly flexible general purpose
programming language.
It is a high level programming language developed by
Guido Van Rossum in 1991 at National Research Institute for
Mathematics, Netherlands. It got its name from a famous
show Monty Python’s Flying Circus
It is presently owned by Python Software Foundation (PSF).
It can be used for Console Application, Desktop
Application, Web Application, Mobile Application. Popular
apps developed using python – Google, Quora, Youtube,
M Bit Torrent, Instagram etc
Features of Python
1. Python is an interpreted, interactive, directly executed
language.
2. It is a free and open-source software having large
repository of libraries. It can be downloaded freely and
source code can be modified for improvement
3. Python is a case sensitive Language.
4. It is an Object Oriented Programing Language.
5. It is a Cross-platform language, can run on windows,
Linux, Macintosh etc. equally
6. Expressive language – Less code to be written as it itself
expresses the purpose of the code.
7. It emphasizes on dynamic typing and code readability.
8. It is extensible and highly efficient as there is no wastage
of time in declaring variables.
Advantages of Python
1. Platform independent – It can run across different
platforms like Windows, Linux, Mac OS and other OS. It is a
portable language.
2. Easy to use (Readability) – It uses simple, concise and
English like instructions that are easy to read and
understand.
3. High Productivity – It is a simple language with small
codes and extensive libraries. Therefore it offers higher
productivity to programmers as compared to C++ and
Java. It can be used in diverse applications like scripting,
web applications, game development, GUI programs, etc
Advantages of Python
4. Less learning time– Because of simple and shorter
code, lesser time is required to understand and learn
python.
5. Syntax highlighting – It allows to distinguish between
input, output and error message by different colour
codes.
6. Interpreted language – Code execution &
interpretation is done line by line.
Disadvantages of Python
• Not the fastest language
• Lesser libraries than C, Java, Perl
• Not strong on type binding
• Not easily convertible
Working in Python
• Default installation available from [Link]
is called CPython installation and it comes with
Python Interpretor, Python IDLE (Python GUI) and Pip
(package installer)
• Anaconda Python distribution is another
recommended distribution that comes preloaded
with many packages and libraries (e.g. NumPy,
SciPy, Panda libraries, etc)
• Other popular IDEs are Spyder IDE, PyCharm IDE
etc. Spyder IDE is available as a part of Anaconda
Python Distribution
How to work in Python
• There are two modes to work in python:
• Interactive Mode – In interactive mode , you type
the commands one at a time, python executes the
command and gives you the output. The
interactive interpreter is also called python shell. The
interactive mode proves very useful for testing
code.
• Script Mode – In script mode you save all the
commands in the form of a program file (with
extension .py) using Python Editor
print (“hello”)
print (“Welcome to Python Programming)
EXITING PYTHON
If exit() or quit() does not work, type the following command