CHPT 6 LECT1 GSWP IP
CHPT 6 LECT1 GSWP IP
Lecture -1
Introduction:
Python programming language was developed by Guido Van Rossum in February 1991. Python
is based on or influenced with two programming languages:
➢ ABC language, a teaching language created as a replacement of BASIC.
➢ Modula -3
Features of Python:
Python is an interactive, interpreted language with a simple syntax. It is becoming increasingly
popular owing to the following features:
i) Easy to Use (Easy):
Python is a loosely typed Object-Oriented programming language with few
keywords (reserved words), simple English-like structure and is easy to learn.
ii) Expressive Language:
Python is an expressive language –fewer lines of code and simpler syntax, for example,
consider following two sets of codes:
v) Cross-platform Language:
Python can run equally well of variety of platforms – Windows, Lynux/UNIX,
Macintosh, supercomputers, smart phones etc. Python is a true cross-platform
language. Or in other words, Python is a platform independent or portable
language.
1
1. Interacting with Python (Python IDLE);
Python is a flexible, dynamic and powerful language that can be used in different ways. It can
be interactively used simply to test a code or a statement line by line or while exploring its
interface
Python is used by Google, YouTube, etc. It is being widely used for system programming, GUI
programming, Internet scripting/web, gaming, text processing, network programming,
commercial robots and in space and scientific interface.
To write and run Python programs interactively, we can either use the command line window
or IDLE (Integrated Development Learning Environment that comes with Python. The
most important feature of IDLE is that it is a program that allows the user to edit, run, browse
and debug a Python program from a single interface.
Python Shell:
When we first start Python IDLE by clicking on its icon creating on the desktop or menu item
on the 𝑺𝒕𝒂𝒓𝒕 𝒃𝒖𝒕𝒕𝒐𝒏 → 𝑨𝒍𝒍 𝑨𝒑𝒑𝒔 → 𝑰𝑫𝑳𝑬 (𝑷𝒚𝒕𝒉𝒐𝒏 𝟑. 𝟏𝟎) option, it always stars up the
Python Shell as:
On opening, Python Shell shows a welcome message displaying its version and a copyright
notice. After this, the command prompt (>>>) followed by a blinking cursor gets displayed,
which indicates that IDLE is now ready to take Python commands from the user.
Command Line Interaction:
When commands are entered directly in IDLE from the keyboard, the interpreter / IDLE is
said to be in interactive mode. In Interactive Mode we can type the command as follows:
2
Python is a case-sensitive languge. This means that Python differentiates between capital and
small alphabets. For example, print (P capital) and ( p small) are two differnt things for
Python.
e.g.,
Note: We can repeat a command in IDLE, by pressing Alt+p in order to save time and typing
effort.
3
Q1. What is Python?
Ans:
Python is a high-level, interpreted, dynamic, Object-Oriented Programming Language that support
GUI programming.
Q5. Python is a free and open source language. What do you understand
by this feature?
Ans:
It means-to download Python, one needs not pay anything because it is Free and its source-code is
also available, which can be modified/improved etc., because it is open-source.