0 ratings0% found this document useful (0 votes) 2 views23 pagesModule Wise Python
This is the pdf of questions answers of python programming for 1st year BE students who study engineering under VTU University
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
By lagi (obo! ibe it deal sie: h
std [ai e0 empl ; :
ope ae fews) otha ‘ef Bae 4
Woariiable sean be accessed \
pant G@) 4 §
1S phV. 6) i aii wf Bene 2 7H A bed al
Peonie ble and! tobe asco i
both inside Rowdtside of
% oschon. a
' iid Ee
/ tb pees 7
Z ‘Local Spt Wikia cleclaned a. ae
ts called o local, ontable. Tit can be accessed
22 within thee Fonction VP4
PROB HQ.)
| are
if TBuprinie oan): ie 5 Bek,
Lefovic Cam, ts axPni me Nluirbe
A oo 5
1B is (ae wetertn f
+ SF ee
\P 5
i
ip
ny
>» Explain Boolean &
Aotors , companison operators ,
and wiestad capd:Hopals) with sufteble § Ryton
__cacamples. 9 ih 2
[eae ae ® vi z
|Booltan ‘operators ane useo! to wombine ox modify
tonditions . Python paovides three Boolean, operators :
eland On not
Example: 4}
| ERO 11
bes(PAGE No. :
DATE: 7Nested Gnditions
A wested condition. ts a0 if Hatemert pplacecl
de sanothey if stetement: :
== 0: p> i
sat C Positive Even, Number
e
sttive Odd Number 7
5 '
“CNegat chamber y
Gy
S Fo) Be it
d_ Number.
fe 2 fs 1 : os U
Bo Fesir fi” beseBEVElop sa menu-based Py
Galiedate fhe
anea of o
Mtctangle -based o1
hoi ce
Ad Area lof Grdle'')z Using SB PYO Creates 0 Kew fadeprrcemt Neb,
eA Changes ilo the Copied list to not of feet
1,2,3) & Output
Hist? = [Link]) listd =f, 2,3]
qaSee a listtcopyt) ib ~
list2 =foo.2,3] _ 3
the rigtea|
‘ees Hist2 =listt b F Uses dist? =1i
¥ :
+ | Both -vaniable efx te.
fist 4pewator 45
in a list.
}
a
eny_list ascot Gis) ys
at (Affe Trsertion :", my. list)
yd
my dist aerove Go)
_ print (After Deletions “aeyatict)
AE Seanch Y vie
[if 20.70 amylish: 1
eee etExample =
ry strogle $1042.30). ae
FH ye tea laft) aso TK
1 is wills Cause ern eamr j)
|( PAGE NO.=
| DATE
Eb See
Ee
1 ences blw clits & Ta
V WA Tdalerh fn Teple d
4. IGeaks using squane YS. Qrearted “ust
; [brackets 2] , wses ©)
2. (Mstable (a0 be mod Fed) 2. Tromictable | C40n
| Slower than tuples 3, ae than |
tmIPG AYILOD, wu mite te program “to xemove
GUist without using set.
gram “40 yemove cluplicates from sm Vist 7+
|
|
|
|
|
|
|
|
|
|
|
|4b evalagy 10 Ry Heo priser van thet Counts word -f.
—ihey in a panagraply using a dictionan y . ke
i input Eater “o panagraph :Deletion ' Operation
Use the del statamemt +0 remove
a key-value pain,
> | Example »
studentis § "name “s
Pome! ‘Rabul’, ‘city’: Belagavi;}
“he
Ww
Lookep Operation
>| Aeéess a value usiog Hs hay
Ly Example - a FO BEN
_stuckt £5 “name”: “Rabul’, age": 20F
fee Gent bla i
iia
Outpu
; j
fname" Rahul”, age": 20}
YiVALSITE a) yp Bh on peace ote PY cinteats og
one File fo anot
SEPP VarMate dapy. cimerts frock file Feeney
S8U7Ee = open Csatyces-tyy
destination
rn)
=pen Odestination.-ty $i!" “uy 0
Hdlata = source: rad)
Ze
Source. close)
destination close()
of :
* | Goteats of distinction bt
Python Prgrammiag
vt
A VID_Belagar£ ‘studenta’: 2 ‘Name's «
i Sfudeo + 2.53 ‘Naar’
4s 1p
Nan’ Sof stidhot 4 SRahus © |
Age of \Sturbirts 20).