Kantesh Raj
(@kanteshraj)
Beginning Python
Programming
Quick Question
Name major programming
languages taught at school or
colleges ?
According to my knowledge
C++
Java
PHP / ASP.NET !e" Places#
Then....
hy we need !ython"
#ets do a sim!le acti$ity %or this
$rite a co%e &or 'Hello $orl%(
in an) language )ou li*e+ other
than p)thon
Acti$ity
&ello orld Program in '
,inclu%e -st%io.h.
main#
/
print&'Hello $orl%(#0
1
(( )o. *% #ines *% 'ode+ 2
Ho" man) lines o& co%e
)ou "rote
?
)ow,
&ello orld !rogram in Python
!rint -&ello orld.
$hat is P)thon?
P)thon is %)namic+ open source
programming language "ith a &ocus
on simplicit) an% pro%uctivit).
3t "as %evelope% in 4554
ho is he"
ho is he"
/uido $an Rossum
'reator o% Python
Python
3nterpreter 6ase% language
7esigne% to 8e eas) to learn an% master
9. clear s)nta:
9. ;er) &e" *e)"or%
Highl) porta8le
9. <un on all plat&orm=S#
>arge set o& li8rar)
9. li8raries &or huge num8er o& so&t"are
'an 0o
S)stem A%ministration
?@3 programming
$e8 Application
7ata8ase Apps
Scienti&ic Application
?ames
An%roi% App %evelopment
?etting !amiliar "ith p)thon
E:tension &or p)thon &ile A .!y
1or e2am!le
Hello.p)
A#iA3.!y
)o 3emicolons
print 'Hello Ever)one(
print B+B
4ndentation
!ileA Hello$rong.p)
print 'Hello(
print '$orl%(
!ileA HelloCorrect.p)
print 'Hello(
print '$orl%(
)o $aria5le data ty!e declaration
:C2
print :
print :D5
P)thon "ill %o it &or )ou A#
4n!ut %rom key5oard
!unction &or thatA raw6in!ut()
3t al"a)s return string t)pe
E:ampleA
:Cra"Einput'Enter num8er(#
print :
)Cint:#+B
print )
print 'the &inal value is (+str)#
4t will make your work easy
8p)thon
ip)thon
0emo 7
Program to ta*e input &rom user
an% print 'p)thon is a"esome(+ i&
user enter num8er less than 2
other"ise print 'Hello A>iAS(.
0emo 8
$rite a &unction &or printing value
&rom arra) using &or loop.
@se a8ove &unction in other program
8) help o& import.
0emo 9
Program to create a &ile in p)thon
an% "rite 'this is p)thon 8asic
session.(
0emo :
P)thon program &or listing &ile in
home %irector)
here to re%er "
P)thon $e8siteA %ocumentation
htt!+((www.!ython.org(
7ive into p)thonAe8oo*
htt!+((www.di$einto!ython.net
Ho" to thin* li*e a computer scientishA
e8oo*
htt!+((www.greentea!ress.com(
httpA//in.p)con.org/BF4B/
Py'on
Any Question "
A5out ;e
)ame+ Gantesh <aj
Twitter+ H*anteshraj
Blog+ *anteshraj.8logspot.in
Thank You