Python Unit 1
Python Unit 1
Bvalue
em h a eprrven ed by an
ubje u
Aae
Phind(a) Jole- to
sbiecy yye inditgie wha) tcind tvalues an
i)4e Gn object can hold.
azlo
Phin (yye Ca) 'in'>
e
-4pe o vatue is dainad as do&a
values t4: i
.vAabk an hod he dill4en tyye
a tsiabe, with e
yfe
we can ge) the daa
islandard dta
Numba
-int -tuple
-lso
- Gumyle
Bulean -dicd iun ay
shings
is a de cina
03, -2:32
numbe and
which nain bh Real Aud
nhello,
b-):S
C= 3+2
de lSúv ani"
Pind (a)
Pins (ype(o))
Pins (yye(b)
Pin Cyyc(d)
hon seq ue ncy
as ethe tom
in lip do nà need A be ol Whe sume tye(r )(mulaol)
1)upleO}: 3wt e l0)tleis alss an od l
()
Tuple is wnen wih biacke4)
se43): rs an ungaed collec)jon o dag typ
in key:value Rai)
'g}
S'hn' iani , heigh yulúe
a- [1o'savnt', tbrs)
b(20,abc', s )
d 'nane';lsváni', 'hei,hs
k1nal hy pes
B Tn
obiecd :
) (sde yheco aie elecutable Piece d
byle- Campiled. usually as ye
Ye
hon sune 4hat ane
) BtE
cumplie
Values miny he
are
fsv
afpoit ksv enecubiun by eihe
.such objecs
by eval)BIF
do o contain any ink MaJ(on
Ahamceves
. Coda ohjecs aYe at
egading evesy uwe-delinecd uncun 2 al of which
Cant5
Ahe hearl o4 enecusin
do contin ssme
tnyveu)jun)
inpul "enHr
expY e val (
enkrepro)n (04203hou
ol!
olP Null
s)xeange dbjec
XQnget)ia siblin, GL
ccased by he B0E
.XeON% objecds ane is limied and when unye)
bed whon memoy
he ungec) 8lF,
unuasually (aye daa set
qeheu* dn
pinsCx)
Comparison
l9al opendors
V) BiBise oferaors
ud to pekssm mallemaial opeution hila
These are divoion
wbucisn maliplaUn ,and
addin,
o pevun do X-4
- ’ s u btyacin o
*’Muiylicaltun ol openndb y
value
YOuL as ineger
ofo ’ Modules
b 20
Pin ("addAiun is",atb)
a-b)
vgh
than,1rue i the
Less
oeland are
Equal 4 quei!
b-0
(ess hkn b:"acb)
Pint (a
asb)
pins c"a qreqr han b
Condii6nd saMmnlsb
(ombine
and lo4ical AO:14e bh e ahundNandy
opeun
(6gical oR ue i ebher o he
oyenen is falk
iogi al wo:Due i? he
v) B)wie opet
7 Bitwie te
aas
bob
Pintlagb)
i lalb)
idenal
CaYe no)
b=0
b)
Pins (a is no
nin (a is b)
slandad Bi!-inkncltun
kfined as the
Lndion hse ncinaliy pe- dehned in pythun he
inkip1tltr hus seveval dundions Ahet are dleaus
yhon knun as B}-i9
These Runcions qe
resen foY use.
inpyh.
kuncdiuns,hoye are sevenal uiH -in Ancions
he given objed he
h soten
()
) intC):nid
phin (*=,x)
AIns(hom prqamminy language")
ole
gphon pqiumning langge
Sravani'
DiN(ien(A)e
Cor l,23
to qel the sym uf number) d an ileae
\aum ): used
lis S= sum (Ci,2/4])
Pins(9)
A -20
in (absCA))
20
snglle) elenenA
qe the
A- nin s213))
an inegrn ale
in); uotd do ge)
B nCo 2)
and many m
Numbes
6inwduciton to Numbeis
used t sore h nuneic
numbtt c Ayps ave
The Numbe obecds ane eard ihen
yúriabe.
vues inside He
Variabe.
Some Va|ue is assigned o a
He relrene a numbe,
w. to dele)e
hon also allaw
keynd -Eg: del a ing
b using the del
numbe
yhon here dre Ahiee tyges
n
wibh no deciy
nonegutic numbh she
are the -Ve
yhon. Houever
on intqer in
olim! on he memor
Poinl. There is Conshamecl by he ampunt
ntqer is
spe ol ha
Ous synm has
unlimixd leng)h.
ha deimals o
type (n)
Rsin numbey)
store he docimal pin)
ve is used to
The loa)) Ayye
{latng in nmhw.numh.
Pins(ypeo)
ol?
cclass-loas'
3 compl Numbeo
ave od he tom at bí whor a i
Complen nymbers
and bj is he imaghary un)
num bev
he veal part o the
nhing bt Fi.
o) she numbtr:he imagnag
a= 2+3j ar 2+3J
(a)
pin (kupeca) pin (a: img) ol: t¬
243j
cclass ompler's 3)
3333 2
o)e
3 pber odanam bea do u
nape the
1yuw wan
wan
asserdks (*)
erain value ie dubl
use
emainclor insyd
want to qed the (o)
opeaor
yo Modulo
in Cae he
quolienk,use
she (hmi/"numg)
o!ping
hon
snvesion in
c
type
eSP the tveolp
qbs():3 g)
"sqy}):The sive
3scquences veyeom
by types hat
cakgy iems canlae accesl
ens Theee
odred colletion o
s o încow on he seguente
by fheit Ausion Ayyeu hat an he
proides sevei-bill-in gequente
Pyahon cálecdiun da.
pula)c
Used to store ond mani
sthing
2)list
)T4ple
) Ranqe
in single (
encloed in
chaaces
qie ctquenco of
(anst
siMmutabk , Meanigy Jin
They ove modised abr
cveu
be (atnan ond
iclucy sicing , Con
opeusjen
* Shing meshds
Varisw sm
a 'Savuni"
2Slist
- Lit is a
They ae maqble Cammas ad ehcloed
ems ae sepera\ed by
-hese
squane ()
backes atpendiy
io a slicig i ineleing,
opin inctacl
i
in (ac2)
Pön) (a¬: ) (213143
Point(a)
[o,
r3igps)6a7,9]
(s)) (1ana 132
Sntrstof specityiy
yhe
atvs steP
'unn.
ange -hep
nepotns type
sequen mutable im an Rang 4)
co
2D
(alD Prin
(at) pins
ope uPle -
sclony ininy ude int iu)ins
imilar ast TUples
annot
be bu) 0) hesis
to Puven
bob o
by
loed enc and(ommas Thus
immutuble art qms
areTUPles
les TUP
Naing Me did coln a
peents a
di' ve
-The aping aype knownas diJnan'es
value puis rals dlouiny guÀ
and muabe r
Dicinaries are
unordlered
daa usirg key S
velrieve
ue and
didionay mw he untque
ina
Person-"nome".'iohn' "'aqe": cy
in (RIn)
['nanw'])
pin ( Pe san "Engineey"
in]
cCupaL =
peson C"o
Phin Cpoun)
30,cyeutyor }
4'and: jhn 'age'
\otupuin'enyjne'
- o Si add(olemen)
S-upda)kse)
-Svemove ( elemend)
(my) ogenses x:
mgthb no
upda
le add Iile
tor nemove
in
sonhvzenst)
(ienebe)
uiy B
Ysenstl
Zundin bi} in )
elemynt he
sed fugen he o
ame eMajn
he elemens uhk "
becan set a of
e any amodifi o3 "
an is set
sel ve'soun immabe
(s) in
()uldase S"
s-t213
(s) S4m -
Min) -
-
¬lea, S .
()
eemenjsdisaid(