—_———}
_ 4
At
[Names Ashisin Yogesh
| Pxperiment NotoG
Experiment Names Perform ing 0,
Peradseal. “Related Q esHiong aoe
tit are the one of the four build-in data Structures in
| used RPE ca onlited calreion oP Mee which mfght
SMDR Government en
[Rall Nos 323 pe
on_lists 2 Create List , rae List 1 He
list (Add item Tua item) ,Delete list
(hen to used list.
sit ichonovies and ets 7
he of different types but ! ‘ ot}.
the Clements that Fiend thin alee
eoclosed in Square brackets,
Ws isin iain >
ot the end of the lish
: Bln
= Returns a Copy of th
= Returns the Number of elemens pith the
Current
Ree[Camiin| Pave ]
‘aike. “ayntax eee Tee
=| Synbax 3
Peco LUst_name. sort () pain
| Exaraple := eee Stet open ome ay ait to
Bi Saeeearee 4 Mii (eh 23,4,21 rem 7 ee
wee NGA pte lees
pees § —print (num pee tia «oo cok d
— || Qutew : RU READE UID Re Be Meio i ai
Gere De] il. oi
a ‘ in Pytho ;
It) Method # + Using Naive Method :
) Method #9 *- jing Operator
Method # ang list Comprehension —
wd #4 Using extend ()
Bhai 8 using Operator
4-Using iterators. chain
" Lists are mutable ' in Python
quence of values. The values are)/ AP +o sum all the items ino list
| def Gum list (items) pit 28
return snide USS et
Qutput 5~ ad oy
LIAP pr om
det rou (i) a
Osa ok
fc i.
——
return a
all the items i—aluar eM usmeom cies GRecniuethesata bleu
___} digits in _a_qumbev __ eset
>) num = int Gaput (Enter ie umber
Some ee ae ect ig scp deed
t| tahile (num>o) 2 Ret ee eae :
Tn men ee ee nes
ere Betmecnininem ae ad ii
| Num = num // lo 3
PSOE) brink (VasSin of Giuin number 2 Ad" Ye sur)
=posaae rf
fokeony- umber + (vat Tee
aE NS Gian Number =
_4)| Jisae thal takes a number ood ches ks apd jahether fb
is a palindrome or not.
—> | number = int Cinow! ut (“Enter ciny numbers") )
feverse =0
temp Jo10
everse #(0) + remainderI
[Camiin| race
SNOR Government paueeien iDhule
— | Quam “Rahul Yogesh Deore seas ntae
Roll No! G23 Branch i- Computer ——h
—____ Experiment Not 04 Subject Python — fs
Experiment Names LAP in Python to Perform Sign de
Rollowing Operations on Tuples: Create he
Access = i Bos Si
_# nes
= tine empty tuple. Lilrite roa Fy tile
—s —in ha ei
—_—| provi = ste pasts and fh ed
Lis providing no iterable- +o the tuple () builtin tuntion
.Empty Tuple using PaventhesissNicos aa aes a (Cin u Print)
List
“Tusk e
\List iso group of Comma
Seperated Values Within
Square brarkels 4.re manda |
~tory va
fq, i= (10.20, eel
i) Tuple is a group Be emma
| eeparoted values bith parents,
and_parenthesis are 0 ptional. | —
ne ——-
= (102.030 140)
4) eq,
[Once ie creates List object we
¢ = 10,20:30i40
Ly Lisk objects ioe raieahle feu )Tugle_obleds_ cue tonmudable |
ie once We Create ,19¢ Cannot
oa any changes in | tts Content.
thot object. | £0} 240 > value Frrov: Tuple
ohjeck does aot support it
HE the content (s Fixedi)
Print the cient rae oe sec
> One To Three Four
bee we (digit)
ne lod (n)s
i=9
hee
iC digits 10s aon m= hebtiery cut Tey
{ print tt eae eae ne hie
[elit digit = =| pe eae aan see 2
H _print Ge end =! bait ea rs sa
| elif dAigit = =" Qty ==
print Gueringess ere he ae sie
eli digit a
Length = len Cw)
Lihile ic length
print Value Cyc),
i
(Nn)
Mh.8MPR Government _ Polytechnic 1 Dhul<
I Name, monn og Deas i : =
Roll No j= 929 Branch 4-(ompute = z
Refine eT Gon ee
So | pep isttemnl iNiameed LAP in Python +o Perform sign —
| toltosing operations on Set screate Sed,
ad: 2
guccess Access set elements , Update set ;Odrte ngebe
# | Practical Related (Questions sho at oe ae
\ | Describe the varinus 4¢t Operation joes te
= Python ets to Cary out mathematical act Operations _
Like Union , difference and Symmebric diffrence . These
Dperations Can. he performed _ ol eames a ome
methods ze anes
Example.
miuyset = 1112134 Output = se
print (myseb) U1 12138
ibe the various methods ot Ack,
has a Set of built - in methods that_ -ypesn
p_ sets
Adds an element to the ack. th ;
Remo all elements From the
Ret ‘ he mset a
pdate With the union of this der
and Orn4t || Exercise ie
yi Ae to create a Set
bennoue one tem Crom Ack. ————
= | var “get = Set (Cio20eD Oita
| print (mek oy War oe)
gdd_mumbera(4)—in-o Att -and
Varsset add (So) __ amie oles os
print ("Added 5010 get 2" warset) Shan)
|| voraset. pop O- aa pee i
| ovint (Removes lo Prom se} 2”, Var Dp
Oubput s- iptv as te
Sot s Cio 20136)
Added 50 in det “Lio 20,0130 1
Remore lo From S¢+ + [2015040
Line +o find the length of Set
qa eek (C5 318 n 424}
| print (“Length of Set, * Venta)
Length of Set 2-4ISMOR Government Polytechnic Dhule comm
ee = baie
Ae — [name 2. Ashisini Yogesh Deore eee
___ || Roll_ No = 329 Branch i- Computer
__|lFxprriment Na--09 ___— Subject 1- Pythan
____|€xperiment Name += UiAe_in Python +o pertorn
| Fotloning operations on Pictionarles
__ Create Dictionary Access Dictionary elements, Updata
dicionary , Delete dichonary Looping through dickionary
sige
—~#) Pradical Related —Quesfinns
4 [Lihat is the output of Fdloising —progielm
24 | didionoryt 2 {Google i1',*Farebook +2! jdMicroso ft: 54
dictionary 2 = {Gea : 1‘ ticrogoft' 29 44s tue! s 4
| dictionary {uy date (dictinr ary at i
for keu , value tn_dictonary 4 - tema (1:
print fe, values) =(amin)
tt _|| Exercise
I arite a Python Seripk to concatenate Folloising dictionaries
!
t
{to create a nen one.
—tHdic dt ¢ 21210 ai904
dica 2 $8440. 44404
_Itdica = { 5130,6160}
Idic4 214
r_|ifor dfn Cdictydice diced) diet. update Cd)
—|| print (dic 4)
Oibpyb tS es
RP 1 tto ,2120,343% 4:40, 5150 61604
ADiLiae to sort Coscending and descending) a dickionary by d
Ge(Cami
/SMOR Government Bey eevs oe
Hanae s- Ashainl Yogesh Oetre. eae
RaliNoz- 829 Branch Computer
____Experiment No 40 __ _ Subject i Python Sign ne
—_____|Pxperiment Pesaran doaasea Math build -in
__ Functions,
___ | stipe to demonstrate tring build = tn EuncHons.—
__# [Practical Related Questions — ee :
SE placa a Yitle Cand oe
= ete - Sveturns string mith Pir (eter of each
Lord «
ae returns string there
fo Uppercase
2)) Give the Syntax aad_sigaifeanse_of shing_Punckons ——
the first character
dnd Strip (1
ace pop les the first character
Sakrio returns a copy of _the string by remaining.
ding e beginning and railing
at the ad tees: (epics is the default
horactey to emove )d={" perce case” 0, “Lower case": 04
| Gov c ind:
Jetatehe tbo per Che z
df‘ verce case | t=4 gris te pe
pif Gut cleetalots eG suuns teyere eS oa ia
d [inca tAse sitet eee
Helse c
H , Pass.
print ee Origin tring +", 4) ‘
print (No « pf VonerCase 1". d (‘veper case")
print Cte spf Lowercase" d
iy
tring teat (The quirk Bron Fo
~The qui a Brot
Output = Original 5 bring
No.of parrcase $4 ae
é sercase « 1% soi see
Float Numbers! oa numbers)[Camiin] Fase
| 5MOR Giovernment Po Lytechic Dhule
[name = AshuiniNogesh pie ores ee
— Rollo x 44 See Branch += Computer H eee]
t nt No:- 1 fi Subject s- Python
{Experiment _ pie ee difined Python aign
| __ function Por given problem ;
| _s Function bith minimum 9 arguments —
— | __+ funckion returning values.
_#) Practical Related Questions
Yi blhat is the output of the following program
det muyfun (text, num): -
(hile num >0:
print (text)
} Num = Num - 4
myfun (Hello 4)pee [tnd chk she imnene et Prime
___=>l| dee test orime (nls Peeters. : ae
poe Cat eet eee ei a
{i veturn False
___lelie (nazo)s
a d) crehiene Thiet
else 2 x
for 2 in range (2,9): _
ol Bae
return alae
l Feturn True
Print (test prime (2\)
Output =
False