Professional Documents
Culture Documents
22 Wednesday: Elp:hello, 50, 1) 2, Love, Raju Pamu
22 Wednesday: Elp:hello, 50, 1) 2, Love, Raju Pamu
ist1:insert l, 50)
print(list1)
del list111
Print Clist1)
olp:-[Hello,'2o 1Mo, 5o, 1,, lovel, leaju, tam
del list
pYint istd1)
P:-
2009
Week 17 113-252
23Thursday
APRIL
16
06
Yemove item) uSed to ycmove an idem rom he
09
Pop Cinder) ; xemove and re turnS ite ts
a t Spocified nder
Ppoemove and etumns last item xom the
10
13
lp-Laya','al,'e,1,2]
print list4:pop))
o]p:-2
Phint llise 1 popl 2))
clear a list
clcar )
2009
24 Friday
APRIL
Tuple
lpclass tupl
Oobther ple
2me Tuple inside uplesmutidimensiong
Tis knDuon asnesHed
tup les Ganga
Giends=( laya", kaviyaLatha
prinEl maYk[o])
print[fiends [oJ)
Laya
without Paverhesis
Cyeated
Tuples Can aso le
20, 50,f0, 11,67
marks
typelmayks)
opeuple
2009
Week 17 115-250
25 Saturday
APRIL
mayks = 6 o , t 6 o ) mayks= 6o,
Print type (maks)) print type Cmayk s)
oP<clasint plp2last'tuplels
Accessing tuple elementS
Tndex Enoy Tnder is out Yange
ype Eaox (Tf 19-08 inSteadoe 1a)
Elements ef a
tuple aan be
they ave assign ed but 1 changed e
isa murta bldata he elements itse
ype like lis E, Hen it can
15 bechanged
2
ieds=l' Layakavya [20,30, 4o, 50])
iends[2JLbj=9o
PxIntriends)
olp
Laya kavyaL10, 30, 40,501)
Deleking a tuple J
ue can delete
entive uple using del keyuwor d:
2009
26 sur
APRIL 116-249 Week 17
Conveyteto unle
1st can be
kupleLlisE
Ruf-in mehods
op3
tuple Count(5)
3
Boolean
TROEFALSE
Stato aSSigo CY COmpaxe boo lean values
SebScribed True
print (type(Subscibed ))
dollouwed = false
Pint ltype lfolloue))
OP clasc boo 2009
cdassool
Week 18 117-248
27 Monday
APRIL
08
a loo
39
blo0
printla- b)
opTue
printCboolla)
o/pTrue
bo
printl boolLb)
olpifalse
Set
Undexed Collection of items
Mutable
Doesn E allous duplicate item slevery element is u
bGeating a et
18
1f-Cunly brace s
ouiHin Selts tuncion
Can have any
no of HemS and heq may be
diffexent types
be
Add/upda-e
Odid) meth s_uced lo add Single elementto the
Sel
upalatet) methad is used to ado mul tiple elements
IEcan take tuple s, list, serings ox ther se as2009
avgeonents.
29 wednesday
APRIL
a12,3,4, 5} a1,3,5,,5f
print la) printta)
a addl6)
a updatelL6,1,8,11)
printta) print (a)
Removing
aiscard(ttem) Speciied item will be vembued
14 he Se
Yemovelitevm) )
a1,2,3,4,5} 0-1,2,3,13
printta) Q discard [5)
olp:-f1,2,3,f
op-{1,3,1, aYempNel5)_
17
adiscavd (4) p-keyEnor55
18
print la)
ofP 1123, 5
aYemove tt)
printla)
op2,3,5
pop)
Remoe k velunsan item
2009
row what Hem15 homhe sel. You neve
geingo bePopped up
30 Thursday
APRIL 120 245 Week 18
set{1,5,3,8,1,
Set pop)
printIseE)
olp3,H5,8,1
Cleay
setf1,5,3, 8,1,4
Set clea)
Printlset)
OP-Sett)
Set operationS
unioo, intexsechion dilfevence, Sqmmebicdi fferente
a 10 20, 30,uo
b20,o, fo,ico f
abUnion = a b Cor) union(b)
pintlabUnion)
op:-10,20, 30, 40, 89,Fo,toof2
2009
Wiek 18 121-244
Friday
MAY
inte sechion: Sel of elemenks that ave Commne
ho-lh -Ihesels
Set1-f, 2,3, tu, 5{
Sel f9,8,1,4,6 f
print (Set 1. intevsection (set 2) (o1)
printlsel 1&
"elp:- u
diPlevence a-b (set of elermentsthat ave
only ina
but not in 6)
Setf-f1,2,3,",5f
Set 29, F, 1,4,6
print Cgetrd iflexence (Sel 2)) tor) print (sel1-Set 2)
b
plp- 2,3, 5}
SymmetiC diffeventeof a and b is
Se of a
2009
Saturday
MAY 122-243 Week 18
s o 2 e ns e l s
mLelable Vesion
of set
Elemen
nEs 0 fozen set remainS Same after Creation
DiChonay
Cveating dictionay
Dictfonavies can be cveated by placing elements
insidleftuly braces
Cuptax 2 riends 1 key i Value, keq: value,keyivale?
4 tales Can be of any ype lavd can be duplicaked
whexe as keys canbe vepeaLed duplicete
keys mustbe unigue and mus be immutable like
1skipg number, D1 a kuple with immutable_elenents)
ue an also use dicti to creakea dickionay
a-L:L,2:432,
a lHj- o
4al6, 5:2s
Print la)
a l103- 1oo
printla)
ue can tven
Cxeate our Own data type
y)Con-terolows
x Contyolflou Sta-ern@ntS e Very
huild Complex and pevformant
impor-.aro
Pograms In aoy
language
(t) T
Condition
tstatements to exeule
eglastBal) -6 astBall-4
last Balle-6: 1f lastBall:6
Print(uwon the match Print'uon)
elses
o P
p-LwOn he malch
2009
Week 19 125-240
MAY
Tuesday
Cti else
9
ifCCond-kon)
Executes if dock
else
#Exetutes_else block
letsride
12
iSeYen
a ram to check uwhe4 a numbe
oy Odd
13
nambeY= intlinput CEnter
1f numbey ==o)
a numbey )
else
printIE iS even
numker
PrintI is dd Qumber)
1 lp Entey a number 10o
It is euen numbey
ntey a umeY 23
I i s odd number
Ct)Nested iP
Iinside anothe
(i) H-elif Jaddev
2009
OWednesday
MAY 126-239 Week 19
Shonlhand i
Shothard ifelse_
StatementIf_True if condition else statemenk tfpafe
yangeCo,) 0le P
1used tor Seguen-ial avercing.
pixednoo 1leva-ionS (olelintte
Vavin 1terable
Skatem Cnts
The Vay lakes the value of next tem om e
iterable each time thxough the
loop
2009
10
MAY
Sunday
130 235 Week 19
50
15
20
5
30
3)
HO
45
2009
11 Monday
MAY
W e e 2 0 131-234
Snech
for in Yange (o,5):
name print.4i)'
f o x i n name
pint
olp:-S
False
StatementS
p h y a y a l y a
y a y a a y a y a
yayayaya ya
yayayayayaya
ya yaya a p yaya
y ya yayagay4ya ya
ua ya gaAGA YAga ya A ya
2009
Wes 20 1332 MAY Wednesday
lo o Corol loop
Con-o slatemems
beak
Coo-inue
paSS
eak ; ReturnS Contol out of he
ConcinueRetuvnS Con Erol tothe loap direl
loo
pass Dsed as a placeholder f utuve
beainning
tation of loopt unctions etc lenet
hame=input Ente yobtr nanme
vowelslisE-[la,le;
fOY
u1
chaxoa cter in name l
FchraCte in VowelslisSt
pinE Lohanactev,TE is vowel)
break
8
olp Ente youY home 2 Loga
a-TE1S Vouwel
2009
14Thursday
MAY 134-231 Week 20
Pass
2009
MAY16saturday
) while loo
ndefinile Herartfon
Lohile ex preSsion
boay f he loop
nBook Cricket
while (i 41: Consider pu hae a book
o 3o pagfs
print li plip the book ill you get Soo
it=l print al he Values (ScYoes)
prlnt no: filpc ta ken-o
olp:- Com plele the Sco SCeYe
2
2009
Wesk 20 137228
17 Sunday
MAY
impot andam
9
print (random.randint 1, 30)
Scoxe O
SCOveTnfo
whileScoxe 500
random. Yaain Ell,30)ScoYe Va lue
11
ScoYe Scoret ScpYe Value
print(Scovva ueyendGcove Value)
Lm port Yandom
SCoYeO
ScoYeTnfo= [1
Luhile S CoYe 5000
SoYe Va lue Yandomandint3o)
Scove SCove + SCove
Value
16
ScoxeInfo:append Cre value)
printtTolal plips len (Scove Iofo), StoveInfo) Score)
2009
MAYMonday 138-227 Week 21
Set ltst)
2009
Week 21
19 Tuesday
MAY
139 226
16) Funchons:
Sumar
P
ce tuntiooName(paxame terS)
Statements
humber1-19
4
nLUm ber218 n Lat
Durmber3-22
number1 lo F0)
print[ s eve Ormat (number 1)
else )_
print 3 i daoYmat (humber
1F (number2 2= =0) 1))
17
pint
'
is even fomat lnunmbera)
elge
Pint C 1s
number 3 = oddomat
=o) CnurckerD).
pint Seventogal
else (number 3)
print is bld
furmaElnumber 3)
olp 1q is dd
8 1S eVen
2009
dd IS elen