PYTHON PROGRAMMING FUNDAMENTAL
5.1.1 Features of Python
• Python is a high level language. It is a free and open source language.
• It is an interpreted language, as Python programs are executed by an interpreter.
• Python programs are easy to understand as they have a clearly defined syntax and
relatively simple structure.
• Python is case-sensitive. For example, NUMBER and number are not same in Python.
• Python is portable and platform independent, means it can run on various
operating systems and hardware platforms.
• Python has a rich library of predefined functions.
• Python uses indentation for blocks and nested blocks.
How to Install Python
• Python is pre-installed on most Unix systems, including Linux and MAC OS X
• The pre-installed version may not be the most recent one (2.6.2 and 3.1.1 as of
Sept 09)
• Download from http://python.org/download/
• Python comes with a large library of standard modules
• There are several options for an IDE
IDLE – works well with Windows
IDLE (Integrated Development Environment)
• IDLE is an Integrated DeveLopment Environment for Python, typically used on
Windows
• Multi-window text editor with syntax highlighting, auto-completion, smart indent
and other.
• Python shell with syntax highlighting.
• Integrated debugger with stepping, persistent breakpoints, and call stack
visibility
5.1.2 Working with Python
To write and run (execute) a Python program, we need to have a Python interpreter
installed on our computer or we can use any online Python interpreter. The
interpreter is also called Python shell.
A sample screen of Python interpreter is shown in Figure:
In the above screen, the symbol >>> is the Python prompt, which indicates that the
interpreter is ready to take instructions. We can type commands or statements on
this prompt to execute them using a Python interpreter.
5.1.3 Execution Modes
There are two ways to use the Python interpreter:
a) Interactive mode
b) Script mode
(remaining content omitted for brevity; it would continue here...)