Elec
Elec
(3)
Page 2of 3
-- - - f -
M~DI
15 a) How to dr.aw a square and hexagon using turtle module in Python. (7)
b) O.,cribe the method., lllld Python modules commonly used for convening a (7)
rolor image to a grayllClllc image,
OR
16 o) 0.•ign o Pyth<ln GUI pmg111111 that takes wcr input for the length lllld width of a (8)
n,ctanglc. and when o button is pn,ssed. c111culalc• and display• the area of the
rectangle.
b) How do you display an image with a caption using Python in a graphical (6)
interface'!
Module IV
17 a) A cws Car with attributes registtlllion_number. color. milc,oge and year. oad • (7)
method to display iofonnation about the car. Write a Python program to create
an in.,tancc of the Car clus and dcrnon.,tratc how to access and modify it•
oltributc,.
b) Deline a b•~ clo.-, "Shape" with onribute< width and h<ight. and a method to (7)
cokula1e the area. Create two subcla.csci: "Rectangle" and "Triangle" inheriting
P:igc 2of 3
UCNICSihJ01JA01
<iuunplc
8 How does the _ini t _ method differ from other methods in • Python cluss? (3)
ModalrW
13 a) Deticribe any two image proc:essiog libnries in python. with illustrlltion of two {7)
methods of each libray.
Page 2of 4
120uUl 34i2052302
Principle. Rate of interesl and time in , - . 35 input.< from the user. It must let
the user choo,c whether they want t.o calcul•e Simple inlerest or Compound
intore.i and tho final output i., di,playcd in • >ingle output filc,d accordingly?
b ) Write • python program to draw a panllelognun u,ing tunic and fill with a (6)
rolor
ModtoltlV
17 a) Write any two type, o( Inheritance In '.Python? Give an eaan1ple r,.- each. (R)
h) Write Python Program to •imulote • Bonk A<X<llm< with ,uppon for (6)
dep,,.itMoney. wlthclrawMooey and 1how8alance Opttotion•·'
OR
18 a) Write Python coclc to overload•·+••. -,d ••." operators by providing the mctl,ods (8)
add_. _sub_ .?
b) Wb.Jc i5 thr . -ol oxc,ptlons? Write • Pythoo axle to nwe 1111 exception udng (6)
the ni. uy,.'O<II.?
lllulrt1'111C the rw,ctiOCI or following methods in tunic (3)
i) 1ur1Jc.sethuding(O) ii)lunlc.forward(SO) iii) 1unlc.lcrt(90)
6 Describe 1..-0 Junclamental difference, bec,.'ttll tenninal •based user in1erfaces (3)
andGUls.
7 Explain what the _ !ltr _ method does and ..-by it is a useful method to include (3)
in a class.
8 Compon, multiple and multiJ.,-.1 inhcrilADCr (3)
0300CSIJ.620SU01
r.todult Ill
15 n) Write n python function to draw• square using tunle graphics (5)
b) Write a python function to covert :an iJDll8e to black :and while using image (9)
processing methocb.
OR
16 n) Write• python (unction to draw nn hexagon using turle gnphic. (5)
b) Write a python (unction to shrinlr. an image by a gi,•en factor. The function suppose (9)
to builds aod return• • new image wtikh i• omaller copy of tho argument image,
hy the focu.- orgumcnt.
r.locllllrlV
17 a) Write Pylhoo program 10 rn,atc • class called a• C:-pln to model complex (9)
numbcn aod implement _add_ ( ) ,and _ mul_ () methods to add and multiply
two <'Omplu numbcn, Obplay the tt11Ult hy ovcrloodins the + and • OJk'••tor.
b) Explain multiple inheri~ in Python with a .uitllhle eXDO,ple (5)
OR
18 •J Write• Python prognun to create• clus called u llolloul to model ration,d (9)
number, and a>.,ociated opcnlions. lrnplenient the fnllowinJ nie1hod• in th< c1 .....
Uu opcrutot o,•crloading.
I. RcduceO - to return the simplif'ied liaction form
2. _ add_() • to add two ratioanal numbeo
3. _ It_() • to <ompare two rotlonal numbcn (leu than operation)
b) Whot b Ex<epdoa handling~ Writ< a program that op,n• • fllc and wril<J "H•llo (5)
Good moring" to it. HDDdle exn,ptioru that cnn be genentcd during l/0 operations
Module Ill
1.5 a) Write• Python prognun to oonvert a color image to a grayscale image. (6)
011
16 n) Write Python GUI progrmm to input IWO llring, lllld output I concalellaled !Iring (6)
Module IV
17 o) Ilium•• the use or ob,UrtlCI c l = in Python. (6)
b) Deline • doll Student in Python with 111ributes to Jlore th< roll number. name (8)
nnd matko of thn,c oubjecu for each ,tuclenL Deline the following rnelhodo:
n,adOala()• to assign values lo the arlributes
romputeTotal() - to lind the total maiks
prilll_deUtils() • ID duplay thi: 11tributc values and the toul nuu'ltli
Create an object of the c""'5 and invoke lhc methods.
011
18 •> Exploin. with the help of suitable <lWDplcs. the different types of iohcrilllllCe. (8)
b) Write a Python prognun to demonsua,e the use of lly. except and finally blocks. (6)
Module Ill
15 o) Write a Pylhon prognun to draw• hexagon and to fill it with red colour. Explain (7)
the tunic mctltocb 11.'l<d In It.
b) Write a python program to <0nven ,. colour lmag< to block and white lmag<. (7)