You are on page 1of 132

Download From: www.EasyEngineering.

net

ww
w.E
asy
E ngi
nee
rin
g.n
et

**Note: Other Websites/Blogs Owners Please do not Copy (or) Republish


this Materials, Students & Graduates if You Find the Same Materials with
EasyEngineering.net Watermarks or Logo, Kindly report us to
easyengineeringnet@gmail.com
Download From: www.EasyEngineering.net
Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
ri ng.
n et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
nee
rin
g .ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
r ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
nee
rin
g .ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
nee
rin
g .ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
n eer
i ng.
ne t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
rin
g.n
e t

Download From: www.EasyEngineering.net


Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

MENTS
UNIT T DATA THPESFPRESS)ONvs, STnTE

n Yau'oud Fnginecring pro%lams


Applicalun ython Solvhng
Vakues
ntepretar and tnteace mara, dabuggtng
Python and listValiables xpressions
ard T ind floa boolean
,
stnng opaton s , Comments
,

tupla assignmant, procedona curculato


statemarb, valuo» two vauahlos,
ustratire Prpgrams: ekchango the
vaiabladistana
etuwoan tuo poin
the
the value> on

Problem
ww python
Applcaloms
u
solving Vauiou nginaering problama

Tntroducton
w.Ec by t Python
veleped bjuido Van Rossum duing 1985-

a
Pythen
s y
was

geneca! purpase. tnt


lod,, ile
pelad
tn teee pn
tie,
thles a Blie,

En
a
1990Pthan level
languaqo.
Proqramming larguago
hih
oñented and
object
Rython is gi
intexpraed
at run nebye
tima the tes preter. So
Rrthon is processed
there is ho need to Compile. a Progam riexecul
before
ng.
ing t.

Python is
Proqrams
Tntaactivn
Python
and
woT
k
da bu9ging
un Tnteactive

a
ne
ocode.
plows
mae. which

t
allows
otacive testing
Easy to loarn
is ceary dofned
and easily readable
A Python Proqram
s Vey sumpla.
|The trcture. of. tho Prog a m
Vorsatla.

Python uPjorb davolopment ofa wide range o aplicalions


tet to
proosin9 to WhW browsers to games.
rang
ongngng an Scinple
Freo ard Opon Souro
T i an open Souo Sof twara So Qnone cantecly
dli bude , read the. Sourca. Code e d i t t .
Download From: www.EasyEngineering.net
SHENNAL
SN DEPARTMENT
SCIENCE OF
AND HUMANITIES
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

High level lanquaqe e

hen wTiting proqrams in Python, tha proqranmers dont


to about the low levei dolails.
have uory
Por table
Python Can run on a wdo Varioty of hardwar
and has the. Sarma. thterface on all platforms.
Plat onms
Obsoc ofantad
object oriented slyle or tachnidua of
Python Suppor
wthn objocks.
w
Proq amming
Appli ww o thon
cations
t haB
hat encapsula tos

.
Cada.

Python
lang uage
.Ehigh
asydavelop
thaB
a

Ubed b
lovel genoca
a
Purpose2 Programming

wida 7ang oapplica bons


Wab and enteprise

En
including nage Processi
ncuding n9, tex procaseng
and numeric data fom
netxork.

gin
lovel apk caftons uing Sientife
Embaddod Siptiqlarg
3D software eer
veb peve lopmont
Python t an easy exBensibla
in Ranguage
g.n tha

Porides god htoq ration


standardS
with data basa. and Bther coas
et
qUT basad dosktop applcaltons
and graphte dosign appkcations
.

Imago procass'ing
ScieNtfic and cornputalional applicaluons
*Ujamas
Ente prise and business applicalions.
Opovating Systom S.
anguuaga deelp mant
Netuwort Programming ard Prvto typing.
Download From: www.EasyEngineering.net
FSNUA
NEOey
DEPARTMENT OF
SCIENCE AND HUMANITIES
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Python- TntapreBe.
Inte pralea
To execute a Proq v a m
n a highlevel Languega
rons la ting One line at a time is calladtntes Ppraleu.
Comslos high lavel Language
To translate a Pogram wntten
a

low. level language


atl a Onca.
into a

Inteproter
pro cassing

wLwcode Socuco, Thteaprate odput

Compilo
w.E
Pre asy Pre
soutput
En
Pocassing CompiloProassnMachino
Souco
Code Codo

and gin
Inteuprate
DHouona batwaen
Comples
eer
TNTER PRETER
CoM PILER
entire
Program Translatas ing program one
Compila Scans tha

transla Bes it as a low laval stabement .ne


at a bime.
and

language t coda ü
No Tnkesmediake objeck
Tnkamediata ojeck code a Geneatad Generaled.

statemanis aua
Condibonal control stataments ad
Cond:honal Control
executes Slowe.
Ereutes faske.

Mamo Raduirament ä mora,bcaus Memony redulrement lass.


Memo
objec coda eneuated.

Download From: www.EasyEngineering.net


NSTTUTE F
DEPARTMEAUMANITIES
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

Proram nead not be Conplad kvey hme highes lovel program is


eyey time, FrroTS a a dis playo Convaited.Frrors aue
dioplaye
afler entvd Proqvam u
Checkad.for evey hstnuelon Tnleprald.
ExC, cH, Compiles
E Python Rcky.

MopES oF PHTHON 2TER PRTER.


Python Intepreles a Proqram that readh ard exccudes
Python Code Tt uses tuo medes a Execution

ww Tnteacdive
*ScripE moda .
moda

Inteuactva moda w.E


a
When wo type tha
dioplays the rasul mediatoly. syE Python proqram in unteacBye mode it

The charron > ngi


the prompt the tntopratos uses to
ndlcale that it Teady to ente
nee
coda.
Ceg) 9 t
loo rin
» print (e Tntoac tive moda n python ")
g.n
ADVANTAYES
Tnteractire moce th Python et
Python Tnteiackme: mada. i gpod enoueh to lcan
exporiment or Explora

Nosing in
un nteiactre mada. Convenient jos beginnars
and for tosting Small Codes:

D1SADYPN TAYE
We Cannot Gare. the Satemenb and hare to' relipe all
tha Staleman Onca again to Te-Tun them

Download From: www.EasyEngineering.net


STTUso DEPARTMENT OF
SCIENCE AND HUMANITIES
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Script moda.
Tn Scrip modo , type python Proqpam n a l e ard store
the le with
wth Py
P ExtonSion and use the Unteprelos lo execude
the contanb of the Jle , which b callad a eript
the
does not aukornalically diplay rosulb.
ython Seript mode.
uwill use tha
the
In ordes to cea oulput Jrom a
python Seript, we

list Values and


slalemet takes of a
Print State menb. This Filo
on tha Standad outpu
Prints then Sbinq represenlalion
terminal
typically direcdel to the
Fta oculput
The
The
window. ww
slandaud

w.E
b
a 25

9
C = atFb
asy
Pint(sun;"c)

En
Otp
Sum 16 gin
Difeono betwcon Intesacti ad Sipt eer moda

Thteaacin moda ing


&ipt mode

Aua
A uay using tha- python .ne
A A way u i n g tha python

Intepretes by typing
sBaemensdnteprele toed
statomerb tn a Snpt.
t ard execute

Pompt
codaCan Sare ad edit tha Code.
Cannot Sara ard edil the
the esulb
We cannot sec
We anSeo the yosults
tnmedialey tnmeiato

Download From: www.EasyEngineering.net


CHENNAI
NSTUTUTE DEPARTMENT QMANITIEs
sCIENCEAND HUMANITIES
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Python TDIE ( inloqratod Devalopmanl eaTnig Enrironment)


wrks on dfferoant falfovms . al Conlains the shellusndoto an
tnteachre intes preles , douga and a mull'window tert oditor
ord
thad has cauras Gke python Coloriing, smaut hdenl
auto Complolion.

Dabuggi
us to d locatig
Procass
Deb13
Debu 99ing tem is

a
populaly
proqran . Itb a Systemahe pocoss
P r o c e s

and ectfying e r r s n

datoch a pYoce
dlofach
or
iec e a

tha nunbe sf bug


s

ww
Spotbn9 ar #ring
So that the software S behaing as expocfed.
expected.

w.Eqhtly
Seftwde when Various
tnpartiCulat
or
hade Complex systems & kern ov

Deugi yslen
Ona $y
n One
ouplad as chargas
Sub eysterms
asy
ause buds to emeqe
anothe.

tntesace
Types
may

Ervors
E ngi
Syntax EroTS
nee
Semantic Erro7S
rin
Runtime Errors
g.n
et

Download From: www.EasyEngineering.net


CHENNA DEPARTMENT OF
ECOy SCIENCE AND HUMANITIES
Download From: www.EasyEngineering.net Unit:
Subject Code/Title:

lor) Valuos and Tpos


DaBa types available n Python
Storod the momory C a n
bo o man
Tha dalta goingto
tha type. of tha. dala,
that a going to
tys Data type
accose wthu tho Proqram

has sir basi dala types


Python
s @Tuplo Dictionay
Numerne gtring9
Booloan
Numeri Data typ: to
nunerc
nuimerie lue.
aalue.
ww types
a
tha nama Cuggesls rajors
Numbers as numbers Python proqam
Thase
of Complax numers.
numers.
wo

tnclude
Can

tn w wse

.Ea
lonq
fou
tegers
floatig point
integeis,
intagers
to a9 untagers.
n d Complax
aan

rtorra
syE
numbers are
whola
Callal Lonq tnlogers, long
nlegers
aa
uohole. numers

must
er
'
hare ngi
Dr' as the Suffi
ao a lla
lla floaking
floating
T h e Teal
hunberS oriactional

A floatog point
nee numbors

nwmber
Qie
is uplo
aceuvate upto

Point nurners A
rin
5 doumal places.
form g.n
Lwiten n the p
ohoa

et
,
nunbers aro
Complax
y ardpat tho imnginany
the noal paut
a=46 298 Floa
F Intog ype a) S b = 13 . 9 5

class: ut s S> type Cb)


class floal >
>S =IM496s32 L
long ype C Complor
> t e Complex (s,8)
clas long ss ye
cass Qomplex

ENNA! DEPARTMENT OF
HDownload
eY From: www.EasyEngineering.net
SCIENCE AND HUMANITIES
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Strings
Corsist
Stin
Stnn a sesuene ocharacters, Lohich may

fetlerS , numbars, Specal Smbols 0T a ambi nalion of these


types rpre sented by single * or doubla quotos.
quotas
cannot
T an Immulable data typ , which means we

the Strinq Onca it is Creatad


modily we an use triple
we uant to specify maltilne Srng
quoles "

>S Strww = "university"


s l r - hello'

>» type lstr)


Str "ythen
easy to ldn"
yey

w.E
>> ype lskr)
class 'slring'>
class 'stria
> type (sbr)
class gtring >

a
A Sring Consisting of syE ony apa malching quoles
are

callad empty sring ngi


nee
ist
ornpound dalatypes often raferre rin
Python Tang D
ofers a

b a n ovdend Gaquorca ovalues of any g.n


toas seduenco. list

dala bypes (int, float,sting.)


et
the a elemank hsde
A st created placing all
Commas.
suae brackat [I, sepauated y
'weltome']
Cog)
g) lst _w,o, 48.5, "proqram ",
> pnnt (st)
welcome'
Lo, o 28.5," proq Tam"

Download From: www.EasyEngineering.net


ENNA DEPARTMENT OF
hHSTTUTEG SCIENCE AND HUMANITIES
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

To access alam ant trom a ist,

l s t da . CJ to aCcass a n elarnent
We Can use tha. undex opocalor
üst having T eloments
Tnder Starts Jrom .
a
t a a ist.
wil have em to b.
tnder

st [a''e 1 'o' 'u']


=

ce)
Ce Print tl»t CI)

ww
Cn) Negativa Indocing
Cn
Python allows negative tvdezing
dor s Seduancas.

ow
2 to
to the last item in the list-2
The
.Ea
ndex -
l a t item
refe»s
and So on
tha
the
st
Second

'abe", , 2, 3, 'yz,
syE 4.96J

pint(st L-1) ngi


4.9 nee
Tuple: rin
The Values Can
Tuple
A
A ba sadtuenta valuos.
they nderad a g.n
teqers. Tuplos are
et
are
be any type and
Comma Sepauated liy Df Values,
Unmutabla. Tuplos
ae

'e'
>tup = (10, ao, 'a', 'b', 'c') lor) tup =
0,20,'a, 'b,

st a not necessary to enclose tuples Paren tha.sis


N we hare to
with a Sungle element ,

To
To Creale a tupe
clude a Commard Jiral.
>>s ti 'a'

ty tt1)
Kclass 'tuple'>

Download From: www.EasyEngineering.net


ENNNO DEPARTMENT OF
S L O sCIENCE AND HUMANITIES
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

Anothee way to Creale a tuple by using bult -tn

function tuple wo Creale a tuple wth Ko arqumen ä


tha & referred as emply tuple

to ti= tuple t frult )


s prit t
' , ' ' u', " ' t
Print ti[ej

whuch means wo CannoB update


mmuta bla.
Tuples are ,

elemanls. Bul we an replato


change the valuue of bupla
One ww
tuple with other.

w.E2,s,
>t C1, 4, 5)

asy
>Sprint()
E 'a', 2, 3, 4,5)
ngi
Dictionary
Dictionavy datatye
a a knd nee
of hash tabla.
. I} Contains

keyValua pis
ko
Dicbonaries

e assgnaad
are
ri
erclosed

access ad wsingng.
Cury braces
Sduare-

n
Can
and Values
3
brackab
be almost ary
et
Python typ
A dictionary key Can

'Age 2o,
Add':xxx' 1
Cea) dict Vame 'AnA

Print dict. koys t)


dicl-
kes t name', tnge", ' d d )
values e1)
sprint (dict .

20, x*x )
dtct values (c 'ABn'
Prink
Prink ldict)
'Nane: PAApge';20, 'pdd':
'x*x *
Download
FENDAA From: www.EasyEngineering.net
DEPARTMENT OFF
SCIENCE AND HUMANITIES
LS
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

Boo lean
Tho. Sumplost built n tye in ython the bol typ
it 7opve sents tha trulh Value» Tre or alse

>s x= ruo.
y = False
leg)
>> type(r) typey)
Kclass beot > class bool"y

None TyR Null Value,


Constant
h Python . T i a
b a special Jalsa.
Teturn alsa
None
None
None.
wil
i l aluays retun
other than Craale
Craate
Compa va anythng b u t w e cannot

w e Can
ww
Compa ra

assign
Nono to any
Variabe
Variake , ,

othes None
Ceg)
w
ye
.Ea
type (Nona)
objecs.

class 'None. Tyra '


syE
None = =0
False ngi
>> a
a
= Nona.
Nona
n eer
>
ing
=

.ne
Yariablas Fxpressions and Statament
t
Variablas
A Vari ala. is a name tha Tefers to a Valua
Teserred
memory ocallons that etores
Vari ablos are

Values T o idon fed easly each Variable fiven an


appropriate nama

tog) subjec! "Python Prqramming "


S am = Aso
P =3.14
Download From: www.EasyEngineering.net
CHENNAI
NLg
DEPARTMEN UMANITIES
ScIENCE AND HUMANITIES
Download
Subject From: www.EasyEngineering.net
Code/Title: Unit:

Tha Jirst sBaloment Croates a Variable subjecd


and ussi9 ns Pythan Propammìn tha Cecond cBate men to 1
third
Vaviable am ard asiqns 450 to H the
Creates the and assiqns the Value. 3,14
slatement Creates ha
Varabla pi
Vasrable> Qra otamples ldentifiers

Rulas must e an undos scoe


The sirst charactor a n idantifro
or a lette.
C-')
X aa not the
Same
ase Senditve (eq) ard
Taont fers a r e
ww
Punctualan
chaacls Suchas , s and 7. aie. noB
alaval

wi th un idenfers w.E ba used asidend:fiars

Tdenk
koyword
fes
anno

an
a syElengh
ba. oany
Expressions ard Batemenu ngi af Values. Vari ables
An epression b a
nee Conbiration
na lian any Vald
VaT ablos

Cormbi
ard opeiators. An ezpression
and
r ing n
Varablos
Python

opouator ardterals
rithmatie eyPresson
.ne
Sum

ab
= at5

a==b #Ralat
t
onal expresson .

a and # log cal xpro ssion .

an
thsBruc n thal tho Python
A
A slalamep!
eecde
interpro te Can

hava two e of statement


Cwa
n thon
Ass?gn ment Statemant

Prind Stetemant
Download From: www.EasyEngineering.net
NSTTUre oe DEPARTMENT OF...
SCIENCE AND HUMANITIES
LOG
Download From: www.EasyEngineering.net
Subject Code/Title: Unit:

AssignmcnB slalements
the Value to a riable.
Assigns

Phint SBalement
print la)
too
Tupla assanmant:
assignment to all of the eloment a tuple
An
An

usinww single
slatement
a assignment
LSi ng
By w.E
using this feature
using
allows
to be
a
tuple oflaviables
assigned aVaues
ues from
on the- let the
of an

asy
ight
assignment

the asignmen
a tuple.
En
n

gin
a,b: lo, do
Cog) Prtnd la )
Print lb)
eer
) Sunyo
Suay two Variables
-

Tuple assignment ing


a =lo .ne
b 30

a,b- b,a
udped
30,10 t
Print la,b)

es
number Variables tha left and the nunmber|
on
Tha of
Values on the ght
g hl
hare to e ama

Download From: www.EasyEngineering.net


GHENNAI DEPARTMENTOF
SCIENCE AND HUMANITIES
LCNOLOey
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Com ments

starts the
with thehash character
A Comment python
to the end of the phy si cal ine
and extends
b
Very easy
oComments ython
Ha king u se.
Hakang lina. t o put Code
Cormment
Qan un clude. a

Ou C odcee ard
Can
be used to explain Python
Commcnts
Tectablo
ma ke. the. Code more
hen tosting
to prevent execu ion
Comments an a uba

Code
ww Tiple
uotalion . . . "*)
*) for
for
w.E
u
It ë alSo poesle to
multiune lommeni

TyRSf Comment asy python


throc En
main knds of
Conmmenb ython.
in ython
here
gin
are
a

eer
They aue
une Cormmens
Singla
-

Sngle une.
Multi
ommenb :
üne ommen
in g.n
(1) Symbot and
A Singla wne
menti oning
nment
thal
bequns
the
wtth
whola lue
a hash

lune
une
should b a
Should et
we-ful wndithe end o the
Consi docod
omment ntund
n.
to a Vaiakla
asigns
n 50 # 5 0 value.
#

i n a . ammenls we
ua d to bmment
n eecd ommenl
Vhen
Mull ine lanmen u s e ful
double duote ("
quote
lines. In ythen tripla
on many used fo Hullne ommen!tng.
and single quole ( ) are.
Author ; Ann

Dept CS
Se cdion A

Download From: www.EasyEngineering.net


SNU DEPARTMENT HUMANITIES
OF
neNGLOgY ScIENCE AND
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Literals
Litoras a raw data ,9iren
a
Varia bla. (o) Consanl .
Variaus tyes o terals
terals
thee are
Tn Python
Numevt lerals
Slri nq ilorals
Speial lorals

*Boolean lerals

Numerii terals
immutale .Mume7L teras Can
Numeric tnas are

be lorg wtow
belorg dferent Numeri cal TRS
Intege w.E loati leval Compler tesal
tera
*

kegular unteq asy


Nomal tnlege numbors

Cea) >ya = 525


En >585

octal
>
iterals
Print la)
lbase ) gin
To tndicata. an
eer ProjJix
octalle ral we
wllue the
8)
ing
Casa
Oo lTDe (tow fotloud uppe lo) Lower

.ne
Oculpud 6

Heradedimal
> Print (z)
ileral Cbase 16) t wll the
dicaBe hoxà decimal teral we use
To
lov) Or.
A
Ox Lybx1b= b
Pref
Eq) >> 7-Ox A to xlb : lbo (4)

>print( 166
b
Sloal teal f-hs.a print (1) oudpu 4s.b3
Complar bile.al >>a - 413.5) >print (a) oud pud4t9.5
Booloan Lloca): >S a ru print (a) adpd Tua
TTuo
Stnng tea s S: "siring
"
>>> audp String Jitexal
Prin1 (s)
Spocial litoual s a : nona }a==none DudpdSpeuiial
teral
pTnt special Download
uteLaj
ENNA
From: www.EasyEngineering.net
DEPARTMENT OF
SCIENCE AND HUMANITIES
NOOY
Download
Subject From: www.EasyEngineering.net
Code/Title: Unit:

yacadanca fopeas
thal uod lo mani puloo
Oferalors av the Construcb
avo

ncude. 4, - . +
the Valuc.
o opeands , o e hasid oporand,
and

Pythen surpor ooalors


djfeon! pes of opoalors
Athmel? ope raBors unary opovators
Cempa son pera torS Btwse Oporators

ww
AsSanmen oevaBors Hembershp oforaBors
w
Loy, ce opexa tos
.E
opeTator Precodana
4Tdenty ope ratovs

asyand
s
Assoialiity
When an expreson has more. than ne opera tors then
it the. Te lafie En
Priori ties of the operalors with res pmcl to
each thaB dolamined
ofher gin
tha order n toheh the expre
expro Ssion
Ssion
evakuatal.
e
Description. er
operato7
vponen lialin
i ng.
Comple ment,
Multi ply, dii de, modulo,
net minus
unary plus unary
_ard flooT
divison .

Acdeition and Subtraction


+, -
lef and rgh shft opomator
Btwise AVA, B.twise Excuue QR ard
Re qulau oR

Compai Son 1 operator


Euallty opo.ators
Assgnment epealors

19, iS not dendby opeLator9


Un, not n
MarnberShp opeaBor3
Download From: www.EasyEngineering.net
not, or, ard. cal opeators
Download From: www.EasyEngineering.net Unit:
Subject Code/Title:

ILDSTRATIVE PRoRANS

two Variables
the Valuos
Exchange Exchang
in third Yaiable.
in
a- nt (input Ente the first number "")
the. Second number"))
b nt (inpul Enle
Print Before Suap") Outpet
pint "a -", a,")b=", b) Enle thanst nunbe
temp a Ente tha Se cond numbes 3

bternp ww Be ore
a &
Swap
b=3
Print nf ter Gwap")
Pi "a
w.E
", a
"b=",b
Afle
a 3
Swap
b:9

a
: ,

syE
third Vaia ble
withoul usi9
("Fnte tho frrst ngi
nunbe "))
a=

b: t
t (inpl
(hpu Enle
the Secwrnd n
number "))
eer
Print Before tuaP ") ing
Print"a= ",
"b= ",b)
.ne
b: a-b
Qdpd t
a = a-b
Foto the fvs numke
Entos the Socund nurner: 3
Print nfter Suwap')
"b= ", b) Bejore Swap
Print a - ", a,
b - 3
a =

Pfte Suwap
Q 3 2

Download From: www.EasyEngineering.net


HASCIENCE
DEPARTMENT OF
AND HUMANITIES
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

Craudnte the Valuas Dn Wauable

def ar ld, n):


Jor un hange (o,n)
Lon CD outauh
obtalon C5,1,2,3,A
whle jo; Rotalian [4,5,13,3]
lemp J51 Rotatuin [3, 4,5,27
Atj lj-
Lj-) = lemp

J
Print (i,' Rolalion,&)
ww
[,2, 9, 4.]
w.E
ar (1,3)

Dis tanca batweon two oint asy


E n
d
umport math

distance. (,, J2 )
y,,, gin
dist =malh. ee)+r*2)
Sl (t2 -K)** +1a-4, 2

ing
d
elurn dist
dslane (,4,15, 16)
.n et
Print pistance.
between tuw points',d)

Oulp
beluwcen tuo poin
Pstance
b.9To5l214 847714

o
DEPARTMENT QMANITIES
Download From: www.EasyEngineering.net
AND HUMANITIES
SCIENCE
Subject Code/Title:
Download From: www.EasyEngineering.net Unit

Extra Program. Progam to Compute stmpte


OProgram to
jind tha area ard In tarast
aTumjerena a circle P=int (irut ("Ente the pamt ")
"))
the. adius"D n= ht linput ("Ente no.of years
T-Sloa (inpu Entee flaat linput "Ente the
ale of Int
area 3.14 ¥r* Y
S-ptn* )/00
*Y
Crcumz 3. 14
Priot snple Int=", $T)
Print (" Arna: ", aroa) odpu
Hiot circum",Circun) Ento tha pamt 0000
5
Oupu Ente no. of yeas
12
Entes the redius Entes the eth of Lnt
Area
ww28.9519194999 Gtnple Interest bc00.0

Cerum
w.E8.84

Proqam to Conver Colcis Pogram to ind t e sum ard


av9
Python
to aon hei
(
a syE |a
condi Entee the. qele"))
F thea. nunbars

:itlinpd (" Fnla a")


b')
C-Jlom(toput
S- 1.8 *c)+32
Jarenheil
n g
int Cinp (
ine is = ",f)
bit (»pd (" Ente
Sum atbt a
Ente c"))
PintThe-
Oct pu
Conigrade. :45
En tee the
e'rSun,'Av9:,
Prnt('sun:
ing avj
ar
Otput
Fnle a
Sun3

IoD Ente b aco Entec 300

The Jacnhe?l - 13.0 .ne Sum boo Arg 300.

Mthon Paqan to
to Conlgpada.
convet
t
faranhat Progran
two variablos
a
to axchanga the value

uing tupla axignment


unt Cinput (" Entes a "))
f- flaad tinpul (Enle tho faucnheit#) |b - öt[inpu ( Entes b"))

C (f-32)|1.8 Print Bfora 6wap"


) Prnt a ", a,"b= ", b)
Pint ("Contiqade =",
-

a,b b, a
Oudp Prin" Afte svap")
Enla the faicnheit yale. n3
Print a =", a, "b- ", b)
Con 19ado : 4s.o Ouru
Entea 1o Fme b 2o
Bejore Suuap a =
Lo, b: 2o
a 20, b=o
Afte swas
Download From: www.EasyEngineering.net
S
DEPARTMENT OF
SCIENCE AND HUMANITIES
DownloadCode/Title:
Subject From: www.EasyEngineering.net Unit:

Proq.am to calaulale avea ooa


triadgle lusi Heron's ormula)
N
*stde of
a-floa inpu! Enle the
the tiangle )
the aside
bfloallnpd[*Fnte
tha hiange ")
c- fbal (npud Fntes the gdsde di
the tiarla
S latbie))a
QTeQ -S+ (S-a) * (s-b)
* (s-c)t*
ww
pintPrea ", aroa)
0.5

ourut w.E
Entea the s i d e q tke. triande
he lrlangleasy
1s
1

Fnle the
3d side

the 3ds'de
t
the trtaala
w
En
Fnles
gin
hrea 56.5b85424949.
eer
in g.n
e t

Download
cHENNAI
From: www.EasyEngineering.net
DEPARTMENT OF
SCENCE AND HUMANITIES
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Tuo Marks

Dofne Python ?
Python s an objech oriented hgh leval language
and mu ti purpase Programminq languag
'tnderpreted ,a na mic

Ugive the jeaturas Python


to use
* kasy
txpressive language

Tntepreted longuage

ww Cross -plalfomm larguage

w.E language
Froo
+objedoente
ard open SOurce

*Extens ble as
yE
Whod Python
n inteprete gin
The engne tha translakes ard eruns
eri Pythonis Callad
tho Python tnteurete Thoo two
ng. the
w0ys to use i t

tmmediale
ummediake mode
moce.

Python Pronpt
ard Sipt made. .
The thtepretes es
The >
the
prompt
net alled
to thdcate

tha t ready for hstnuclin


whad meant by value t python ?
A Value is One o tha fundamental things. k a

atte 01
a humber that a pmgram manipulaBes.
a

Python ?
Lis He standaud daa typas Python?
TYre NumberS strings ist ple
Dhetiona
Download From: www.EasyEngineering.net
CHENNAI
NSTUT
RSY
DEPARTMENT OF
ScIENCE AND HUMANITIES
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

mode ad made
6.PoLanta betwean nteLactive eipt
Tnteractie modo Scipt made

A uny 1 w g he Pythonn
P way ing
the Pythan
ntepre te tread and exeuke
nte pretes statermenb
ytypig Statemenb n a ipt
at prompt
edit the ade
edt tha ada
3. Can Sare G
2 Cannot o ve and resu l t
no See the
se can
3. e can Sae tho resulb m medêatey.
nnediaely
ww be by an dlantifer
7 stout
w.E
tha rules

Can e a
tollawed
Comnalon letters, diq.t
Cundetscor2

Tden"fier
keycwords asy
Coords Cannot e mel as denbtfers

An
An don bfies canno
Start
En th a digit.
Lka!,@,#...
E k a ,@,# h au
hve cannol we
ary special
Symboto
gin
denifer
Can
lo 6 any longth. eer
Idenilerss
t python ? ing
8Dno
reserr
words
eser ed Coovds t
Cvevds .ne Python
Pthen Ne annot

t
ae
the othev
twords any
Key Vaiatla
Vauala
n
naam
maa unction
name or

as

a
koywora the Syntax shuchue
wbe ued b dofine
identier Thay
thethe pythonlangu
not
F a s e , True , f , wkilo
Ce)

Deneunchon
s b pmram
Whuch Conss
sts of sels sf
a
Functi on
tosk
tnglructh ons
webpeform a peufe lage proqram
,
A

to small bus ldiog locks calla unchon


s ct va
Download
CHENNAI
From: www.EasyEngineering.net
DEPARTMENT OF
INSTITUTEr SCIENCE AND HUMANITIES
NOLOG
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

10
Defina Expressions ard Stakemenb ?

Expressfons
is a ombinallon f values ,
variablas
An kxpressi on

and opeators Ega b+c


ablc
statemenb
inte pre tev can executes
Snstruclono that a Pythen
Oue
allod st akemant
statement
#assgnmant
a =13
Pint Statement
Prnt la) #
ww
IDaine w
low
Tha
oexecukon :
.Ea
brde n which Statemenb
executad u Callad

the tlas Ercuuhion syE .


Erecuhton
at he fret
abuwap bgins at the fret
at
ecubed one a

State ment he p
tho
SBatermenb an
ngi ae

flas o xecuho
tima un chon deiniliond do
,
not altes
nee the
the PLoanm

rin
Peine paLamateS ad avgumens g.nparthests
et
en

the Values provided ttha


PaLa melors e

wrta anction heade


whan oe

Ceg
cog da Sum la, b) :

the value povidad


Arguma» uncioncall

Sur )
ine modules Python
A madula u a Jla Containinq
then aRHon
uncion taBomants ard thstructona

Download From: www.EasyEngineering.net


CHENNAA
INSTITUTE
TEHNOLoY
DEPARTMENT OF
SCIENCE AND HUMANITIES
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

4 Mention the types agumenb u y ton 2

augumens
kozpord
peault angurnan

Redurergumens

Variabla longth aYqumenb

I5 Some buiIt o madule» Python?


st
math madue
nandom
ww thraading
wstrin
.Ea
Collechors

tknt
s yE time

ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


ENNAIC
TCHINOLOg
DEPARTMENT OF
SCIENCE AND HUMANITIES
Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
r ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
in g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
neer
ing
. net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
e eri
ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
neer
ing
. net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
rin
g.n
et

**Note: Other Websites/Blogs Owners Please do not Copy (or) Republish


this Materials, Students & Graduates if You Find the Same Materials with
EasyEngineering.net Watermarks or Logo, Kindly report us to
easyengineeringnet@gmail.com
Download From: www.EasyEngineering.net
Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g .ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
r ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
neer
ing
. net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
n eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Subject
Download Code/Title:
From: www.EasyEngineering.net Unit:

NIT- STS TUPLES DICTIDNARIEs


Lists st operations, list stcos s t methods , list loop,

alasng. cloning ists, Ust parameters; Tuplos;


mutab;by ,

return vaua Dicionaries


tuplo assgnment, tupla as
methods advancod list procossing.list Cormprehensin
operations ard studanb
stucenb marks
lustrati ve programs Stmple Sorting, histogvam ,

Statement ,
Retai) B:) Prepaation.

ww
Secuendo
data structura a roup of data elamanb that
ave

Put togethar
w.E
undeY one
Data StucBure dejines
ovganixing dala
name

data inin aa Computev.


Computey
a

Parti cular way of Storing


the most
and
msic dala'
s
asy
r u c B u r e t
Python.
python.
Tn
In the
the

spacifie index.
Secuona
Saduen o
ts
data Structuro
undex Valuos
each

Starb from
element
E
Zero ard is
en the
has

the Sec
a

ueen
ecu ngi
automatically

nce
The
The
ncremented for
elemen n
the nex
nee
List Values, Tha rin
Valuos i a üst a v e
ist is a Sequenca.
Valuos, ard it
of
also callod a s elemenb
alled as elhments
g.n .
Comma.
List
elementu
separatod

must
must

b.
enclosed by cLar
bracke [.. ] and
brackeb [

et
Valuos
the
Syntax List Variable val1,vals...
elements
element
list that it can have
key feature of
The
koy
The
a

Same dala types


daBa ypes or

that belong to dferenb


t = [ 4 , b, 8]
Fg
Ast 20,. b8hello', True,Python
:

called
aalled an
an empty
emply
A s t thaB Contai ns no elernan á
st
Download From: www.EasyEngineering.net
CHENNAI DEPARTMENT OF
ScIENCE AND HUMANITIES
ECHNOLOey
Download
Subject From: www.EasyEngineering.net
Code/Title: Unit:

A List with» anot har U'st called Nastad l?st


n t = [i,5,8, Laa a, 'abe'], 4
accass tha elom ents tha s t
accos
usad
access Valuos n ust sduare bracket
are to
To the ndev,
l u e stored at
the ndex to jel
along t hoperation s
Sce along usea to acess
Valuos t sst
t
and also s c e

Syntaz S e d lst [start:sthp : shop]


output
F s t elamen b [5, Lo, 15,20,
25, 30]
At L5, o, 15, 2o, 5, 3]
wwst ",
Print
elemenb ", bt)
Firs element 5

Pint
pint(
w .Ea
Frst elarnent
st
lst[J)
[1:3J", Jot[1:3])
st [:3 [ , 5]
[s,5,25]
pntst[::2}", sy kt[::2]

En
t[:2:

Updating Valuas in st
sts aro mutabla .

gin of
The valuo of any element
sido
nsido

elamen
tha Lst c a n be changed
ble
at
eer
any time. The
point
with their ndax Va lua
,the ndex

in
access
Of the
of
Lst
the Ust are

ends Lwith n-
a luways starb th

I'a', 'b','e o, 2o,


o ard

30, ho g.n
>
> t
st
=

[3) =15
e t
>ssAst

T ' a ' , , ' e ' , 15, 2o, 80, 4o].


7a versing a list meanS accossing all tha elamenb
Ver sin9 ist
Tra a

s . Travern9 Can e performed by using for loaop.


the
st L98, bb. =
13
, 58, 48,57 18
f o rfor lst
oP 6b
73
Print (1 58

Download From: www.EasyEngineering.net


DEPARTMENT OF
SHENNA
SCIENCE AND HUMANITIES
NL
Subject
Download Code/Title:
From: www.EasyEngineering.net Unit:

>>> nlst Li,a, 3, [3,4, 5], J


tE3]
[s,4,5 3

for for i nlot [3,4,53


Print l b.

LigE 0pera tions

Descn ption Erample. oud put


Oporation
Returns length of ltst en CL1, 3,33) 3
lan
wwb operator
Concatenahon Joins two ksts. Ths bdone
sb
a [o, 5,b]|
[a, a' 'z7|Lo,5. 6, a,

w.E lsk
>> atb

=[1o, 'a']|
Ist =[to, a'3
a','']

Repelition
Tt
a shy'*yE
Ropeab
perforad
elomans tha 'st.
opeiator.
,'a', 1o,a)

chacks f he value b
ngi ' a [io,2o30] False
Present the st
nee
nol n
chocks 1f tha valuo n o t
Prosent in the ltst. rin
' o not
Truo

g.n
et
Retuns maximum valuo ss lst = [2, b8,45J
max max (lst) 13
t h a list

ReturnsS mini mum valu Lst- [o, 2, 4e] 0.


mun > mun (dst)
nthe liet

Add the values the ist, |»s lt Llo, 20,30]


-

Sum that has numbers Aum Clst)

new sortod st. |>> lst- L5,2,4,,C,24, 5,1]


Retuns a
Sorted (at) [5,2,4,7, ]
Sorted Estis not
The orinal
Sorled
all items in > lat = Liy 2, 3] True
Returns True i
al iterebla are truc sall llat)
, otherwise l s t LO,),2J
ttuTns eee Falsa
FHENNA DEPARTMENT OF
Download
HSTÍio From: www.EasyEngineering.net
sCIENCE AND HUMANITIES
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Redurrns Tue ans eleman> lst=[o, !,2]


tn the ist is truo.ftha > any ( st)
it 7otums >st=[3
st Ys empty > any clst) Fa lse
False.
ist ma thods.
has Various
to help
fo
procranmmers
woTk
Python methads

effrci ontly toth sls.


0Paratien Desciption ard Syntax Example Outpat
Counbs the nunber of times lstlst- [5,6,7,8, 7.4
Countt an elemant appears à tha Ist.Count lb) 3

wntax:w ist.Count Cobi)


st

w.E
Prpords an elomant to tha kst l a s | lst [ i , 5,2]
an eament at tha erd of the. ,5,2,8
appondt) |add
a
ISyntax: tst.appand s(obj)
Jtst
yE
Istppard (8)
lst

ngi
Retums the Jawest ivdex of object| »>Ast L5,36,a'
inde C) h tha list. ves a alue Frorts lst. nder 'a')
object is not proscn h the lst. nee
Synlax kst. indez lot)
rin
insertC)inde
Tnsart objoc aB tho 6poctfiod s
n the list.
lst =l'a', 5, ] |
g
bs lst insert (1, )|'a', '>, 5,8] .ne
Suntar: st.insentl'indar, obj) Ast

>> lst -5, 6,23,£


t
Remove o dololes objac
Yemovet) om the ist. Ist.remove (a3) |I5,b, 46]
Syntaz ist. remove (obj) Ast
Rono ve the
elernent at the lst Aat le,2o,395, =

Spodfiaindex from the s .


Popt Tncdex an optional paiome.ter st.popt
f no uhdex is speuifadthen pop la) Le, 20,51
Temove tho last elemenl fom lst
he
Syntax kst .

pop ( [indax])
Download From: www.EasyEngineering.net
SHENT DEPARTMENT OF
AND HUMANITIES
SCIENCE
LCHNOLEa
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

Reverse tho elamenb the- ||> t =[15,N,28, 387


reverseL t re voTSe (
st 9,28,17,15)
Synat Rst.rover se t)
=[8,4.415,.J
the elomenb n tho lst s totSDTtC ) C4,6,12, i5]|
SoTt C SoT
)
Syntor 'st. Sort

elaman tha Est to |Lst =['a','b', J| T'a'b', to,


extendt dds tha anothe ist using > st 30[w, 20,30
the end >s st). extend (kot2)
+lor) t on a ist i Similai o o,30]
to using extendc) Ast
ww Syntax Est1. extend (Lsta) bta

w.E
Laoping n usts

Python's for
a syE ard tn @nslruc ave useful toorking twhen

ses.
w th
acces each
The for Va
eloment n a st.
n in s Statement a n easy

gin
easy way to

orarn b ind he sun eamens e eri


a list

st , 5,20 40] wsing


n
Lang g .ne
unchon
Sum:0
0r un 2at st= [u, 5, ao4] t
Sum - Sunt
oionge (lenl Lt):
PrintSum ', Sun
Pront (index', )
opud Indet D
nde
&nder
index 3

HENNAM DEPARTMENT OF
Download From: www.EasyEngineering.net
SCIENCE AND HUMANITIESs
Le
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Muta bit
The tst a dala shrcture This means the
muta bla .

elemenb Can be eplatad iserted or ronov. A sice operoBor


On the. left sde f an assnment opoualuin can update Sig

rmulliple elemens a tst


st , 'a"',r1a', 7
J= 75
lst [:3J-[85, 'abc'] oulpd
C15,85, abe', 15]
print (bt)

ww
List aliasing_"
An bjec wth more than One Teerance hab more ond
than one

name, So w.E
tua
Say that the olject b allasel
asy,
b=a
bua En
True gin
a7eferS an ohject ard assigh bza,e then
eri
both Vaaial
Vaial

9He b the
Garne

a
objoct. The assocakén of a Variable 'th a n
ng.
Dbjed b callel
Cloning Lst :
roference
n et
Assgnment sBalemanb python do no Copy objecb
coP
ketveen tuo objecb qo muta ble
They Sumply bnangs Croale

Sequence aCopy an exisBng oed may recured,


So that
Cn oliect con e Chonga without afaking another
another.
In lisb, cloning opeLauon Can e ad b Create a copy
coP
o an exisin st . So tha changos mode un one
Copy of ust
twill not afect another The
The Cop
Copy Contains the Same elemen
as the original.

Download From: www.EasyEngineering.net


NS A DEPARTMENT OF
ECHNOLOo SCIENCE AND HUMANITIES
Download From:
Subject www.EasyEngineering.net
Code/Title: Unit:

Mathod1 ) st () funcion Hathod Ia. Cory.copy )unlion


no ist= lst lold Lst) nowust:copy.cryloist)
'

st i ,9,3
nlt=list (b1) Lmport Copy
Prnt(t, b) t w , 20, 30, 4, 50J
Pnot hut", nlst) nbl copy. copy
bt LiJ=7 stLo)= Loo
Print(st', lst) Pnot ( ' t t )
Printl'nlet, nlat)
Pnt'nls nl»t)
utped
ww
L,3,)
nlst ,a,3]
Oul pud
t[oo, 2, 30
nlst L2, 3)w.E
Lst [i 1o, 3 nbt [o, 20, 30)

asy
List auametevs E ngi
hen wo pass a ist to a Juncticn, 1kaunctóne
to the Rist.T he n e e
funclicn modfes a ist
change ri
a eeenco
Paua me ter, tha aalla See tha
ng.
the bsl

de hsval lt);
tingert 1,26)
ne t
Ast[ab, 3s, 49, 57
Print Belore thsevlon ", lbt)
insval (ttS
Print( nfle hserun " bst)

t and the Vaiable st an ataes yor


Tho
Tho paamola
tho Same objocd

72349
3-57
Download From: www.EasyEngineering.net
COLOg
DEPARTMENT OF
SCIENCE AND HUMANITIES
Subject Code/Title:
Download From: www.EasyEngineering.net Unit:

Tuyle
Tupla a Seduorce Valuos of Came e dffean types
Sopaualad Comna. Tuple. a Sedueno 5 Unmulala ohje
pauenthesis to do.na ib elanant. Onea a tuplá has
Tuples u
|been crealod u Con'! dd elarnen a tupla or vomove

elamenb rom the tupla. .

Croating Taples
Tple wth nteger data item
»t- (i, 2,3)

wwthC1,2,3)
Tuple ww dtfouan dabatPeS
hello", .5.14,EaTre , 98) 75,

Lhello', 3.14, Tmo syE ,


15,18)

Cm) Nosted Tuple n gi


t=lis, 18,45, 37.98)
(7s, 'abe ",
nee
elament i dtfrent oha!
Croaking a tuple with ona

rin Soma

elomant ,hvaned t ad
tuple with
g.n
one

Cwhen e Creakng a

Cormma atte the elemen

Lo tl et
n Tuples
Accessing Valuos
To access the Valug a
tuplo, iE u necessauy to we the
nder humber enclosad shuaua brackat aleng hith tha nama

tuple
u i n g suaa brackals sicin
>tup - ls,65, 95, Lwo)
t lo, o, 30,75,95)
pint ( tC31) tup L1:3)
Lss,95)
tuptup C:a
(15,65)
Download From: www.EasyEngineering.net
ENGAY
NOL DEPARTMENT OF
SCIENCE AND HUMANITIES
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

Basi Tupla oeialons


OLalon Deseiption Exampla Cupu
Concalanalin Adding tupla elarnands al tha
end >>a 5o, bo)Xyz')0 bo,5,
b:(25'
anbiho kupla. elamons s a tb

the th n a = (5o, bo)


Ropoang tuplo (50,bo,
Repeition no times 50, 60)

element is a = [s, 63,98)


Hambershup Reluvns Tue, f
Prexenk in turle otherwise ba a
tn, not n 9 8 not a Falbe
Tetun false.
ww Returns nua , f all elemants in ay2,3
Compori son
w.E
both tuple. a r e a n e ,
reuns false.
otherwise >
y
b:
a==Eb
I,2,3 True

Returns asy
minimum Yaue un | a: 5,4,0, 12

mn
tuple E ngi
mn la)

Returns maci

tuple
mum Valo i
n eer max
a 5,9, to,
la)

ing
mar

tuple
Retum to)Convert tuplo . tupla
.n
([[o,ao,a0) Cto,
upla( he.lo') h,'e'',"',
et o')
20,30)

Dolete the entve tupla > a =5,b,7


dal della

Ba Tupla methnd >st (,45,36)


ndet) Returns tha indat f tRe frst 1
t.ndar 453
madched iten.
SHn inder lob)
Reluvns the Counttha enn = =(5,6,54,5)
Cotunkt) s t . count l5)
elomend
t . Count (o
Download From: www.EasyEngineering.net
DEPARTMENT OF
DAS SCIENCE AND HUMANITIES
NeY
Subject
DownloadCode/Title:
From: www.EasyEngineering.net Unit:

Tude aGsi gnmet


Tup assignment i a Vory atla che and powelydeaa
in python T altorws tha a shgniiant Valuas to a tula ot lariables
anthe left side the asstg Hment fom the turle Values an the
Sdoe t the asslgnment
hght
The nwnber Variables tha tuple on the
lett of the
Oseignment must matdh
matoh the
he
nurmber o elemenb un ta tupla
the aseignment
onbhe aht of
(25,35,45) t u p : (to, o, 30)
Eg: Ca,b, c)
SS> print la ,b, C)
sprnt (aiy.9)
w
25 35 45
Lo, 20,30

Swap w
tupla as9ignrnen
two

> a , b = 7o, b5 w.E


numbers

>S

Print
a,b : b,a

( 'a:
asy
', a, b : ' , 6)
a;bsb En
Tuples as etum vaues gin
Vavi abla lenth arqument tuples
Varaba numer oCqurnent

the
Tuples can albo e etuvnad by
Taturn Valuoas
Can abo ba eer pasead to a anci on
funcion
ing an +
as

onealy tha unuon returna onyoneA Vauablacolleb


name procadad
tuple a urcon 5tarisk
tha ayqumen ito
Can efurn more han one value
"a tuple
.ne
d e di tun ta,5)
u o : allb Output Sun 0
Burntun(*t):
t
150
em Q7.b cohilo i lan lt
Te kum (duo, rem) Sum 9un 4 t
b,2)
a t (ipuk () Tetum Sum
b lput t) a Suntun (to,2o, 3o, 4o,5o)
c ti bun la ,5)
Print la)
Print le Print (Saum fun ( 1,2,3)
*Tuples be wel as koy fov a
Can
dvantae tuples dicd gauu hd Lst donne Lo uved as t
+ Tuples a e unmutable
Tuplos a sital pr rng dolo thH
Tleali thveugh tuple u fasl i write proBochad
than tecahng ove a Lst Mull pla Valucs Cone elarneLnga
Download From: www.EasyEngineering.net
DEPARTMENT OF
sCIENCE AND HUMANITIES
Download From: www.EasyEngineering.net

Dic tlonaios
Dre tionay s an unordaad collouluin elomenls . An e lorment
in dicfionary ho a koy value pau, Al elemant cn dicionary e

placad ths.do. tha ay bratos . 3 Via


Elamenb in diclionauy a e accoscad kos ard not by thoa
Pos7tion

Tho Values f a dictionauy Con be any data bye.. kouys must

ba m mutable daBo type (numbes Stiras,bupto).


Operalions on dicHanauy
*Acossing on elornant
*pdat

ww
+Add elomant

w.E
Mambershup
0paradions Doscripu
Exampla

Croating asy
a Creabng a dicionauy
th

of difauant daBakypres
S>> a : 5'Namc': 'AAA',
'no': 123

dictionary
En elarneri 2Nama': 'AAA', 'No':1233

gin elomenlh by al'No alo


Accessg an

elemant
Accosi ng

usinq kep.
tha

eer
123

> ing
af no=b18
to koy
.ne
value
Assigning a new

, tho old value by >> a


updote at eplacas
new Value
Add nauw eloment nto the a
t
Mame': 'PAA, 'no :189

L'AgeJ:18
>a
odd elerrant dicionay wth key
ama' 'AAR, 'o : 16,'oge ';18 j|

Koturns ua ftho koy Proent a 2 Name'; 'AAa, no';bts2|


>Nama' n a
momarShip n dictionau . otheroise
Tne
etuns falbe ge not a
To

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

Methods de lnouy

Dosc Tiption.
Methad Fxampto
troturn9 apy o diciona
Copye)s
a : a » : 'PythanMarks:953
Cory dicliorau? shoed
ts
Copy) br a.Copyt)
Pint (bY ctonay b
'$ub''Pyi hon', ' marla 95
Rotu nsa new vew of the|
tems a=
f I: "one , :two" dittionay itorns at diepla
a . itomst)
a st q dBctionauy tkay veala)
dclitems( [C1, 'one' , ' tuuo'J) upla a

wwdiel-keys (ti, 3)
keya) a . keys t) t
a
displays liet of kas
dicHonay
Yaluas() w.E['ona a.valuos c) displays ist
| dictidnay.
y values

Pop(kay)
aict
a
valo» [

a.popl1) sy
two)
Remove tho elenent with
two' E
SSS print la)
ngi
'3: kwo Koy and neturn Hs Valuo
om tha dictionay,

Sat dodaul a
kay, value)»y a.
neer
='sub: 'Python','Nauks':95
got dataut lpopt ', 'Hech')
key
e
o the dictionau
turns ts Yala, kay
Print la)
': Na) hvth a value f ditii ing
not Present, nsert ke

'Sub': Py thon, 'Maks':95, Dept and r e t u n ditti onauy


.ne
ufdaloldd) >y a=f i:bna'
> b: f :
>a. update Lb)
two'j
Twill add the dicbionay
t
wth the exiskg dicdionai

prntta)
'one', a: two'
ron kaupt key = 'epplo', Mango
Creates a dictionany
0 alue -'fruib'
d : dict. om
D
kep (kay,value) rom Koys and Values.

2'PPpla fnaib", Mango: ruib


cloat) Remove
> a- Narne': "AAA'ge : 18 j Kemove all elomenb
tron he dictionav
a . cloasL)
print ta)
Download From: www.EasyEngineering.net
Download From: www.EasyEngineering.net

ent) >len (a) a raturng tha. longth


dictionay
dol t ssa= 5'Narme' ' A , 'Pga ";3j Jt wl delele the
del ta) en dactionay

st Comprehensi on

isk Called ist Compra hansion.


Python Suppor Cornputed
ist thto anotha ist
& a toot or transtorming ona

wexprossion
Syntar
st= ww fo elomant s t f t conditional

this .Ea
eduivalond
b tb
or eloment sstyE
ngi
Cond

Containingne
exp
7ollouwod
ConSis ibrackols
e
horve for ri
an
expresSion ,

clauses
a tor clause then LeLo 0r
r eterns
returns a ng.
vesult ist.
vesult i st.

into one n
Comprehension aways
The s t
The
Proam
to Combine thrrae lines
i
Code
Codo tnto Dre

lb)]
et
i * 3 tor i
range
aubes
Print (cuhes)
Lo,1,8, 27, b4, 1257
we Can also
w the list Comprahensi on to Conbine the
elonenb tuv is

t
, 8D, 120, 8o, o, 24°, 1bo, 320, 4 8o
Download From: www.EasyEngineering.net
Download From: www.EasyEngineering.net

above Code i equivalan! t


the

6oY un ao, 40,80]:


[ ,4,J:
L.opperd (i 4y)
Print Ct)
TUushaBre problams

Histo qrams

ww A histo qram shous


tal Qxiin
the roqueney on

dyrantion
anothei ddmantion
the Verbica avis

w.E
hongon
and the
Halplst lib Can e lwa b
create histoqamS usually

t a
also sy
has bins where eyey n has a m i n i m u m ard maximu
oquoncy tetwoen and vnfinile |
Vaue E
Each n has a
ngi
eeg) Uport
tnpoyt
num
matplo b
np
mlab an
ne
mlob
as plt eri
tinport ratplst Lb pypot
wo n
X=1, 22, 23, 3s, b,1,8, 45,b5, 18,
g.n
hun bins =5
faths = pll.hist [7,num_ bins,
jaca slor lue', e
alpha = o.5)
t
n, ba,
plE Show C)

20

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net
TlstraBie J:3
8 3 , 5 3 ,1 7 , 2
Seloction Sort
a= tht (iput Enla the Sie f bst 23 q l T Exchane

19>)2 (T) 5 Exchange


JEA,
Pint ("Enlau the elomenh ") 812,53,29, 19.
fori Tange lo, n): Pass D i-2

stapperd (int (iput t)) 8 1 3, 19

fUr nange (o, n-) J 3 , 53 >a2(T >Exchange


torj 7ange (it1, n):
v = 3
pas9
temp bt[J 8 1,1 the alues

wwtI= temp 5 3 23 lT) >

1 , 33, 5 3
Excha oge

Printe w.E Sorto Valuos


ao ")
Inseron Sovd
Print } )
oupu
Enla
a
the
syE n-t npd
Sima i s l . 5
('Enla. tho sinye
elernenbs ")
Ls"

ngranqe
ho
Print (Enlä
Fnle he elomen lo,n):

The
Sortad
i1
n ee
7
apprd
Valuos
8
ae
lst. Gt lapud ()

L, 2, 19, 23, 58]


for
rin
range l,n)

Bampla T,9,12, 19,8


tolila zo ad
lss g.n
- J >:EA
pass: izo
J=1 63 >2 3
(T
,
> rchange
the valuos tenp et
19, 8 orEj-i] = tep
23 5 3 , alues
Exchange the
23 1 (T) >
2
253, 23, 198 Print ['sortod ist")
Mo changs nts)
2 > 9 ) E)
J 3 EChange
2 >8 lT) >
J , 13
Enlo tha Sinpe s+
8 53, 2 3 , 3248
:27 4
Enla tRa elemer

pass
53, 3 , 1 9 , 1
Sortods}
8 , 14, 24, 27, 3
j- 53 33 CT) > Chare
8, 3 , 3 , 19, 1

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

Exampla Prinl pnchased procddelail


8
3 Pnt )

J= Print| Total anourd:", total)


21 14 94 8
l ="istui" "chostate" "pen",
pencil'", E v a s e "
27> ) Exchange
8
21 3 2
datail")
21 a 24 8 |Print("pmduct prico
J "bisuuilas,"chocolak
27>0 F) No change uit pYiic :5
27 3t 2 8 o, "pen "; 48,"percil"S|
ase"4
JS, H, a7,3, 9 ,
|34>a4L7) chan9 e Punt luritpvio)
stock detai L
7

J=
ww
4 3,8 int"prndut

prd biscui!": Lo, "chowlake *

4
36 w
1 4 lT) &change
8 > Condikon
21
.Ea
ailb pen" 28 "penci) ":
Fase:54
5

H 24 27
syE Print lprod )
i u h , n)
378 T
441
xchange
33b ngi Print ("Curvent
Stock de tai u)

|J:3.
34
218 (T) Exchange
21 3
Dutpu
nee
Pnnt(pod)

T) Excharge
Procuch Pra detai
rin A8
J
24>s

6 24. 27
36
biscuil: 2s, g.n
hocotake : to, pon

4>8

a4
(T) Ex
change

21
-

sb Produ ct
Ponti);8, Enaser
lock debaib.
chocolale
e 8o, fon :
t 268,
2bisuil : o,
[Ratail b l prcpaualan ponct)58,Era ses:5
Product detais
product deia
V

aef bil) (,n): urcharel


ChocslaBo pen 'ponil'
total o bisuil
Faso
Tolal am ount 19o
Price urutpie delai .

SBock
qvrent
Prod L 7o; chocstale , ponab
total = total t pite 2
bisu 8 3
ponu); 56 Frus ;
prod [1J prod [«]-n

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

Shuderds marks SBaBemant efurn avoLage (rosulb)


aYeuage (numters ); n name": "kumä" ASsesSme nt"
dof [a0.0, 971.0, 85.0, 92.0],
total Suwn(numlerS)
tota) floal ltotal) ASS 9nment ": 88D, T0. 0, 4.0
av tolal/( len lnurmers) "ltendanca ": [S5, 0, 90.0Jj
retun avg
ment
de getaYcuag (studond); na rame"; Vecna ASseg6
LO.,
AScesSment aveage (studend [ L tw0.0,12.9, 98.D
"; f82.0,88. D,).o]|
nssewmont hI) PSsianment

SBdent
AHendanta ": [eq.0,97.003
HS Sgnment =aveLage l
rame": "pacpak", *Pesess
man
L"nss gimend ") n3
ww Altendoance )
nsS mer
5o. b
Loo.0, 81.o, 75.o,
AHlendante z
ayemge lStudont
Llo.o,15., 18,0]
w.E
to =o.b ASsos Srent tO3 *
ttondan to' :]wo.D,
na]
too.DJ4

asy
¥ n2,
Studons [n,
=

HssgrmenBtoa
*AHerdbruHor Sudant s h u d a r s :

return tot
E
(score) ngi Print
Shudont [name

fu B6oesSmend )
studant
)

de gellottec -qrade prin


Score =91: nee Pnnt (Student ASSIgnment
)
nttendance.'
veturn o"
rin ")
Prot(studerd fu

, e) -g.
mauks
Pin "Aeage
eh
refurn n
Score=");
eturn A*
Print(kuma"
n)))et
Gel-avaage lni)
letlet-7ade

Pont(Veera: "el-letbe-grade
el SCora >=b1: -aveage ln2))))
e t u r n "B+"

eli Store = 5 0 ;
Prnt peepa:"jet-lette -9rodo.
return B
gel avouage (na ))
else
e tun u " Pintclas Avengd Haiks"))
class_ aYaage (studanb);
Print(e_class_aveiage lstuadenh ))
de gel -

Punt(class Aveage pde")


vesulb C 7
Pont e lote rade lgel -
class
for Studeo shudons:
avea 3tudon )
rge -aVoLage (sBucent)|
vesul. oppord (7
Download From: www.EasyEngineering.net
Download From: www.EasyEngineering.net

Oupd
uma
900, q1.0,85-0, 92.0]
Ces.0, 70. 0, 94 DJ
Les.0, q0.0)
Veena
Loo. o
98.o,
Loo.0, 92.0,
8 a . 0 , 83.0, 9).o]

Deepak. o
50,
TS.0,
Lso.D, 67. D,16oj
w D , 15 0,

ww
Lo. oj Lo,oj
A VeLage matks

KunaY: A
Veena w
O
BT .Ea
Deepak
class AveLage syE
Masks70.o

Class AveLago rade : B+

ngi
nee
rin
g. net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

Two ma kg
Dofne list Sle t h exampla ?
A parl o a usf is callad ist slice. Tha Oporalibn m nJ
Telums tho. pavB the is orn nh dorr b nth dor includina
bu excluding the elamen a no
the elemond al the mh indet
ndet
0 t =
['a''b','e'", '2,ajJ
L:3]

?
by cloning uth example
list
wha do yau moan

ks and aso kaop a opy s the


we want bmodf a
Re Lsf tiself'
The

Ongnalww we
reed t ma ka.atallaN
leto maka
be2 atlo
o
process
copy
atst
tst clohirg.
clohing.

w.E
This
. tho refeena
ust
1,2,3,4)
asy
az
s
Ceg)
b a[:3]|

En [,

3. Define gin
st aiasin9 bla b
Cwith example .
anothe
anothes ,
Loth
oth Variale efers
Variabe ejers

w a asegh ee
the s a n e obyett.
One Vaia

rin
to
2,aJ
>S a: J,2, 3] b g .ne
True
a is

two dfeand
dffecond names
names and b,
a and
a b,
t
ita
i u

ist ha tha anothas


he anothe
The
The true
th ona
alias afo
made
oliasal. changes
cala

a
o,3,3]
with example
Defne naste bs that appoa as an elamant
b a list
A nestelet
c anothe isl.
S> nesl abc' , 2, o,ao
Download From: www.EasyEngineering.net
Download From: www.EasyEngineering.net

5 Tllrale nagalve dexing s t with an exampl?


P
thdo xig for eduone
for typos
Prthonsuporb neqotire
lst takos the - i Ae,
ub. last t e on the
ke Th dor and So on
ilom has tha -a
to tha last
tho seCond
h'o'n
st L-

daleta an ebnen t h a lisl temg


6 Houw Can we
delele one D more
o
del can ba. wa
The kay woyd
he entire s t tself
n a is or
bt 2 ,3,+
ww
log) del

dol t : 1
stfinder
d e l b+ LaJ

w .Ea
C,3,41

tupla ?
String a
7 convert
syE
a
Hocw coverted a a tupla by uing tha tuploc
e
A Strng an

hunclon ngi
'm', n
togss uple ['proqammig9)
P ' o ' , 'a','¥ 'a', eer
'm', 'i', 'n','7)

Python program
to Swap two
Valuos
i ngtupla
8 write a

a6Signment 85, 5 .ne


b- 35

a,b =

Print la,b)
b, a t
usa t tplas ?
oint out the methads
yeturns tha numnkeu clemens hhich i afua
Count t) Tt to
the i e n 'elonment

under t s tp = l'a 'b' 'e'a'


J tup Count (l'a')
It relurns the under f tke
gven elonent
'e')
E3 tup l'a','b,
tup.tnder lU)

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

kow ae wa as etu rn Valuo»


Fxplan tuples
Can turn tuplos roturnn Vaue
funcBions
todo Suoap lx y)
e lurn y, z
a 35 ole a=26
b 35
a,b S a r(a,b)
"b: ",b
Pnnt('a=',a, Sion
Dato type Conver valuo/|
th Example (o) no tyre q
1 Depne coercion

Con verS1 on tpcading


hangeD

C o e r ca o n
Data typo albo knowrn
to anotho cal type . s
Vaiable
t(950. 15)
tog)
ww
s z l o a (200)

200. tha contains


thato ntain

wrtaa
pythcn w.Eprogram
geneialo
to genoLala
a
ddichionauy
chonauy

nunbers t the form of


asy Y,T*z)

nunbe; ') Enlos a nunte


Enla
En
a
n= nt (hpd { 2:, 4,3:9,4:
t ango , na1) 4
d f T : Ttr oz
gin 5:35

Prnt Cd)
ad eevse looku e eri rressonding
C o vrosponding
Valuo
Valuea

5 Peina lookup
okue
tho procos9
dicionauy
indn the
indin9 the
.teg)
ngkay.nt
hay
Valua = did

orn
et
a

Hor
Tor tha
the a ven
kay the the
Procos9 nng he
laokup
koveyse
Yen value

b remembaring
oremembering result results
Deine memorO"
e#echvely ejors ord tho returning
vetarnirg
ord he
tha nathocd pubs
Memorinauon

Calls basad on the esultagain.


tha esultagain
methoo Corn puin g
votkes than Cornputing
vesull atke
the renembore d
the

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
neer
ing
. net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
rin
g.n
e t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
in g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
e t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
e eri
ng.
ne t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g .ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gi nee
rin
g .ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
ginee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gi nee
r ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
ne eri
ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
n eer
i ng.
n et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngi
n eer
i ng.
net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w .Ea
syE
ngin
eer
ing
. net

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
En
gin
eer
ing
.ne
t

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net
2Maila
toai a
puthon Suip o dlihplay &e cuuunt daui TL
LAu Tan 18, e7J
mpost datatima
n a = datetim. olautinu. nol attme
| Paunt Cunt dlah aol tina sung Str mabhod og da
Ohjett"
Pant CstrCnouo))
oulput: euent dat ond üme Lsin StT makhoo of dotitime

objett
o o2-10 t634 4o 218229
Uo sit not On modulaa Pesian Cau Sanl8, 21

w
peommw
Moduls ase PsawaRtten
Commor tasts lite
pucos coda tholt al uLo
genesabng landdonn numbers
PEomingw .Ea
mothanabiCal opeaatons
oith-P exunsion tho has
A Module à a

syE
i
tunctions ard Vauables
that
t a t uould
uouulA

ngi
al
nions
ug n otha p a a m .
Moclutes a Uad to
nee
baaahdouon asapaiam

s mall manageoble ardl


ongcunlZad4ls and ie
rin paov?d
SAuabit of Coda
g.n
what ú
Aile&
4u?
a dquent o chaaauters
e
u toReol
kaReol
t
on
on aa

hand dsdve floaush mamory C|


Pencnent madium dike

CD- o
what Pomat operator?
a n opeiator C/.) holt talcns a
*Fomat operabor
arda upl au înput ond pnssats a lbung
Hormat slu formauttad a
umont o he ple,
ha Enluds ta
petfind by ha tonat sting
. i tha maluus perator
when appiid to inteaAs
& the
But ohan the fiut operand à a Stuhg 7.
fomas opehato.
Download From: www.EasyEngineering.net
Download From: www.EasyEngineering.net

shat &Commard u aagumant ?


that halp to
Python paovidas a get opt mate
E pat command- Jine otto na ad angumand
Piheneat Pa og a
ohat a modulas
Modulas as a fle onbainin PHthon dtobmn
ond dani tions
what au packoa244?
of uollacding s l a t c
ww
A pactag u u t a u
matule tgethen ithin a i g l . u Jik hienaahy

A well
w
.Ea dauctoias fo enatey
angantiucd kResanch of

Pthen
s yE for dtsackonles
packnga haa ad nodutes
ngi
what aa Excaptions? nee
rinand tha
kssoxs Can alao ocaus at uuntirns.
aaa Callud Exutptions g.n
eA b
e
to
t open doea not
e i t ALNo

found Eor), diiding a number bg zao (zuoivuonrre


Madule butng to ngost a odula ord & not Rurd
(tmpost EsaA) etti as ertuptiors

Download From: www.EasyEngineering.net


Download From: www.EasyEngineering.net

ww
w.E
asy
E ngi
nee
rin
g.n
et

**Note: Other Websites/Blogs Owners Please do not Copy (or) Republish


this Materials, Students & Graduates if You Find the Same Materials with
EasyEngineering.net Watermarks or Logo, Kindly report us to
easyengineeringnet@gmail.com
Download From: www.EasyEngineering.net

You might also like