007 Python Introduction
007 Python Introduction
007 Python Introduction
com
In C++ In Python
int a=2, b=3, tmp; a,b=2,3
tmp=a; a,b=b,a
a=b;
b=tmp;
VINOD KUMAR VERMA, PGT(CS), KV OEF KANPUR &
SACHIN BHARDWAJ, PGT(CS), KV NO.1 TEZPUR
for more updates visit: www.python4csip.com
• When you install Python, you get everything i.e. you don‟t need
to install additional libraries. All functionality is available with
Python additional library. Features like web-pages, database
connectivity, GUI features are available in Python standard
library. Python follows – “Battery included” philosophy
Interactive Mode
(Immediate
Python working Mode)
Ways
Script Mode
( )
( )
( )
( )
( )
print (“Hello”)
Save the
program
and press
F5
( )
VINOD KUMAR VERMA, PGT(CS), KV OEF KANPUR &
SACHIN BHARDWAJ, PGT(CS), KV NO.1 TEZPUR
for more updates visit: www.python4csip.com
Note:
1) In Python 2.x print is a statement, not a function
2) Python is case-sensitive i.e. it will treat small letter and
capital letter as two different entities like m & M will be
treated differently in Python.
3) We can use up arrow (↑) and down arrow (↓) to select
previous command and press enter to recall and execute.
4) print statement is required only while working with
script mode otherwise in interactive mode values can be
printed without print statement
VINOD KUMAR VERMA, PGT(CS), KV OEF KANPUR &
SACHIN BHARDWAJ, PGT(CS), KV NO.1 TEZPUR
for more updates visit: www.python4csip.com
(c) (d)
Johny Johny Yes Papa This is my first program
No Papa Johny Johny Yes Papa
No PapaLittle Star
VINOD KUMAR VERMA, PGT(CS), KV OEF KANPUR &
SACHIN BHARDWAJ, PGT(CS), KV NO.1 TEZPUR
for more updates visit: www.python4csip.com