SUBJECT QUESTION PAPER COLLECTION

CS23C02 – Computer Programming in Python

Anna University

Common to all Subjects Common to all Subjects Regulation 2019 Semester 8
1 Question Papers
2025 Earliest Year
2025 Latest Year

📚 Previous Year Question Papers

1 question papers available. Select an examination session to view its question paper.

PDF

April / May 2025

Computer Programming in Python

Historical Examination Intelligence

Based on available extracted papers. Question groups and frequency are provisional, not official syllabus weightage or examination predictions.

1Source papers
1Papers with questions
21Question occurrences
21Distinct question candidates
0Exact repeat candidates
100.0%Extraction coverage

Papers by examination year

20251

Question type candidates

Other Or Unclassified14
Definition5
Design2

Detected examination patterns

A+B+C1

Search historical questions

How would you represent a loop (e.g., for or while) in a flowchart? 2 1 L3 ftLpri)^6jnuj (CT(Sl^giffiffirTLi_rTffi, for^ebGugi while) ^ q j uitujgijlj U L ^ g l e u CTsiiQjrr©! L51ijgl{^gl^§j6ULJU(5l^§)«3'ijaGiT?

0 eligible source papers

What is the difference between is and == in Python? Give an example where they 2 1 L4 behave differently. gcnu^^rrajfleb i s UDrbguib == ^Sluj&Ufbgufficg gi6?nL_(Suj a-Girerr flSl^glojn-ffLD 6r6OT6OT? ^ 6 j n 6 u oSl^glLurrffiDrrffi Qa= LLi6bu(SlLb ^ ( { 5 2_s5n"ijbOorL£) Q,Krr(5lrajaGtr.

0 eligible source papers

What is the difference between the global and nonlocal keywords in Python? Give 2 2 L4 an example use case for each. g^nu^^rrgoflGU ^etrGiT global LDrbguuD local eurrrj^em^fficg^ffi© crenreor 6551^@UJrra=Lb? 6j6ijQ6uiT6orri51fi)@LQ e?® ^-^rrijbooi uuj6OTun"L(5l ffULpffisnaffi QffirKSlrBJffiGTT.

0 eligible source papers

Why is a base case n e c e s s a r y in a recursive function? 2 2 L4 6^® <3^Lp6br^60)6u QffUJ6burrLLH.6b ^ i q . u u 6 O T i _ 6ULpffi(g ejm j q e u ^ a J L i i ?

0 eligible source papers

What is the output of this code? 2 3 L3 @fl5lLLTLlii).6or QGuerflulCB^ CTSoreor? f = lambdax, y:xifx>yelsey print(f(5, 8))

0 eligible source papers

What is the output of this code? 2 3 L3 glisg ©fiJlulLiii.enr QaiGrflulCbl CT6ct6Ct? print([[i *j for j in range(1, 4)] for i in range(1, 3)])

0 eligible source papers

How do you import a specific function from a module? Give an example. 2 4 k l 6^(5 Q^n"@@u5l6i51(!5r5gi e j ® © n J l L J i i l L L Q(FUJ6UurrL6tr)i_ CTeijeurTgu g)P<g5@LD@ QfflLIGllgJ? 6^® 2_^n"IJbOOI LD Qan"(b1r5JK6TT.

0 eligible source papers

How can you handle multiple exception types in a single except block? Give an 2 4 L I example. except Q^n"(g^u5l6U ueo eS\§\GS\6oa,(g, 6xi«nftS560i6TT CTeiiairrgu 6?nffiUJrr6TT (LpLii.LgLb? e ^ ® ^-^rrgfcooi 10 Qs,nQ\mis,6h.

0 eligible source papers

What is the main difference between a stack and a queue in terms of data access? 2 5 L5 2_6tr6TT (LPSSSILLI SSUgUUrr(5l CT6OT6OT? l o t s

0 eligible source papers

When can you use binary search on a list? 2 ffi® ULiii.ujei5l6U anuGorrfl Gslsotsu eruGurrgj uuJ6OTU(5^^^GurrLb?

0 eligible source papers

Design a flowchart for an ATM system that allows a user to withdraw money. The 7 1 L3 (a) flowchart should include the following decision points: (i) 1. Simulate checking if the user has inserted a valid card. 2. Simulate authenticating the PIN. Include logic for retrying PIN entry up to 3 times before blocking the card. 3. Verifying if the entered amount is less than or equal to the account balance. 4. Simulate dispensing cash and printing a receipt if all checks pass. 5. Otherwise, show an appropriate error message. 6^([5 uuj6OT6inrr ufeooiLh 6T(S)ffiffi ^giiLD^ffiom ATM cSH6n)LDUL51fi)ffirrsor AL Cc L5l6OTeu(!5Lb (lpl4.si| LierrsTflffiGfr gicrjaa (S6Ufcooi(P±i: o 1. uuJ6onj Qff6i)giiuiii.ujrr@Lb ^L6OTi_6?nujff QffoSlU-iGrrGTTrrrrrr A - X CT6iJru6in^ff ffrflurrrjuuetD^ 2_((56Uffiuu(5i^girEiffi6tT. 2. PIN g cSHraSarfluusOT^ 2_((56Uffiuu©^§jmjffi6rT. =^Ll«ni_«nuj^ | l gCblLJu^fD® (LP6OTL] 3 (Lpemno 6iJ6inij PIN a-strafLgOTL ififeooi^Lb (Lpujfb^uu^fbiKrTeOT ^ r j a s s ^ S O T ^ f f Gffrjffiffiei^Lh. 3. s_6iT6Tfli_uuLi_ Q^rrGOTSs 856ooi<gs(g gicrgusOTU &i5lL.a ©etnrDain'aG&urr ^6i)a>g] .EFmLDrraGeurr 2_6n"Grr§iT CTGoruetngff ffrflumj^^d). 4. .gHSOTgor^gi ffirrCffrT6ff)SU85(6i5Lb G ^ i j s ^ ^ Qurbnorrsu ueooi^eiD^ 5. g)6b«DGVjQuj6ofl6b, Qurrcis^^uDfreer iJlsOTLpg^ Qffiiigletnujffi ffirrL©. (ii) Explain the logical and bitwise operators in Python. 6 1 L I Gfnu^^rreofleu a_etTGTT ^ © a a iD&)^\h iSiCmGUGro Qs^ajpcgn^laGinGrr ffl5lGTTas@r5ja6tT.

0 eligible source papers

Design a flowchart for a Car Rental System where a user can: 7 1 L3 (b) 1. Select the type of car they want to rent (e.g.. Mini, Sedan, SUV, Luxury). (i) 2. Choose the rental duration (e.g., hourly, daily, weekly). 3. Provide their personal information (e.g., name, contact). 4. Check the availability of the selected car type for the given duration. 5. Confirm the rental details and calculate the rental cost based on the duration and car type. I 6. Make the payment (credit card, debit card, cash). 7. Print or email a receipt. eg® anrij GurTi_60)R ^gjnu^uL^ffiarrgOT 6j>® urrujGij 6)^6TTaauuL_^65)£B QjLq.6iifflr)L£iffiaajLb, ^gleu eg® uojeorrj L5l6OT6u®6^J6OTeufr)«D!Dff QffLLiujGurrLb: 1. ^GurjffiGtr 6iirru6tna5(K{g G[Q\3is> 6)51®LbL|Lb asnrrj GUGmssetDUJ^ G5iJ!BGls©aa6ijLb (CT.ffirr., u51eofl, QffLrrsOT, SUV, Q f r r r ® * ) . 2. airrugmas <Krra)^6OT^^ (S^rjai QffiLiujGijLb (CT.arr., LDGOoflCfBrrib, @6OTff[fl, airrgrrrbglrjLD). 3. ^ajijaerfleor ^ e o f l u u L L ^a&ueuaeiDerr suLprajaeiiiii (sr.arr., Q u u j i j , Q^rrLtJLi). 4. Q55n-©ffiffiuuLt_ ffirreu^glrb® (S£5ijrBQ5®«'5UULi_ a r r i j 6U6mssu5l6OT 5. G u i T L O T a 6^6iJ[jr5iffi6in6n" s_giJ@QffLLJ§i, ftUGU ^ e r r c i ^ LDrb©j±i fl^rrrj 6U6?nauJl6OT ^ii).uu6?r)i_u5l6i) airrLsmffi Q f f G u s i n e u a ffibooiffiSli_ei|Lb. 6. ufcooi \h Qff^^girajffiGtr (S)Qrjii).L a r r i j ® , Q L I J I I I a r r i j ® , Q i j r r a a L i i ) . 7. r j ^ e m ^ ^ f f ^ L G i j i h ^ G U G U g i ii5l6arfln"@ff6u QffiijujGijLb. (ii) Explain the working of different repetitive control statements in Python. 6 1 U 6?nu^^rT6ofl6b ueuGGugj © © L Q U ^ g l o i h u GUCT^LQ a i l ^ L J u r T L l ® ^fT51a6OTa<RGTfl6OT Q f f U J 6 \ J U r T L 6 m i _ Q5lGTTSS(gn5JffiGtT.

0 eligible source papers

Write a Python program that takes an integer n (number of rows) and prints a 7 2 L3 (a) centered pyramid where e a c h row contains numbers increasing from 1 up to the (i) row number and then decreasing back to 1. An example Output is given below; 6?® (LP(Lp n (burflfeTnffffiGTflfe-OT feTfeweooflasjDffi) 6T(Sl^§i, egdjQGurr® 6ui/l6inffu51giiLb 1 (Lp^el) euffletnc? CTbooi euewfj ^ ^ a c f l ^ g j , LJIGOTSOTIJ 1 ^ a s s @6mnDrBgi 6u®Lb CT600i(!fe60)bii<ftj Qibireifoi i_ eg® « n L D U J U u ( S l ^ ^ u u L i _ L51rjLi5lL«r)i_ j H s ^ ^ f S l t b 9 ® €!S)u^nm r^rremGU CTCtpgj raft GIT. 6 g ® CT(b^^§iftasrTL(Sl Q6U6iflLi5'(Sl SGup Q as n'(5l (5 ffi LJ u L © GrTGTTgj: 1 1 121 12321 1234321 123454321 (ii) Explain higher order functions in Python with illustrative code examples, 6 2 L I bmu^^rreofleb a _ u j i j Gucflgmff GlffUjebun-CblaeoiGrr a5l6TTftffift orrJltd'LCBl CT©SS)<RffirTLl(blffi(6T51_6OT Q5l6ITffiOrnjffi6tT.

0 eligible source papers

Write a Python function def is_happy_number(n) that determines whether a given 7 2 L3 (b) positive integer n is a Happy Number. A Happy Number is defined a s follows: (i) 1. Start with any positive integer. 2. Replace the number by the sum of the squares of its digits. 3. Repeat the process until the number becomes 1. in this case, the original number is happy, and the function should return True. 4. T h e sum of the squares of its digits is found to be already present in the set of already encountered numbers. This indicates that the process has entered a cycle that does not include 1, meaning the original number is not happy, and the function should return False. QffirrCblftftuuLL GrBtjiDSinrD (LpctpCTSOOTn eg® iDSlLps^Siurrbcr GreobrbOOTrr 6T6OTU60)^ grJLDrr6cflffi@Lb eg® bmu^rrsOT ffrrrjetnu def is_happy_number(n) CT(Lp^6ijijb. e g ® uDSlip^^ujrrbDr CTbOoi L5l6OT6ii®u3rr£u ai 65) ij oj gu a ffi LJ u © Si fD gj: 1. g-G^guih CiBiJLDflnnD (ipcLp CTbooi^i_6or G\^uL.m&G)\\h. 2. CT600i6iD6cor ^ff^dsT gieuasirajffierflgOT suijffiarnjRGrfleiiT £fo.L®^Q5rT6tDaujn6U iDrrfDfDGijLb. 3. 6T6OOT 1 ^ © l i i euetnij QffUjeu(Lp«r)fD65)UJ u^eobrCSlLh QffUJUJOjLb. girs^ fl!llQil.UJ^@6U, ^ f f S l ) CTSOOT LDSlipff^Ujrrffi gl®5S@Lb, G l O ^ l i l QffUJ6UUn'(Jl a_6OTT6?nLjDUjrr(K g i ® a f f i (S6U6obr(5lLi3. 4. giGUftssrsjftGTflbur ojijffiffirEJffibrflbor 5 m . L 0 ^ Q ^ r r 6 U ) f f i ejfbffiGurGbu CTglijGlffirrGiTGrTUULL CTbOoiabrfleor Q ^ n o u L S l e l ) g l ® u u g j ffibooi i_f!51uJLJuL(blGrT6rTgj. QffOJebcLpflnnD 1 g 2_etT6TTi_ffiftrT^ @ ® @(r5LQL|Lb. Example Input: 19 19-^ 1' + 9' = 82 82 ^8'+ 2'= 68 68 ^6'+ 8'=100 100 V + 0' + 0'= 1 Output: True (because it ends at 1) (ii) Explain the different types of function arguments supported in Python.

0 eligible source papers

Write a Python function def multiply_unique_elements(A, B) that: L3 (a) 1. Multiplies the two matrices A and B using standard matrix multiplication (i) rules. Validate that matrix multiplication is possible (columns in A = rows in B). 2. Extracts all the unique elements from the resulting matrix. 3. Returns the unique elements in the result. eg® 65)ua5rr60r a=niJ65)u def multiply_unique_elements(A, B) CTGOTgu CTCLpgjr&Jsseir: t 1. !^6OT6UUJrT6OT c^eCOfl QU([5ffi(R6U 6)51gl556in6r7LJ UUJ6OTU©^gl glgSOOT© ^eooflasGfr A LurDgULb B QucrDffi(sS]fDgi, ^emf] Q u c f j a a e u ffrr^glojib CTeoruem^ff ffrflunrjffiffiojLb (A gjeu 2_6rT6TT Qr5®6ucfl«Dffffi6fT = B gieu 2_Gn"6n" QjrfleOTffffiGTT). 2. 6)5l6ff)6TTr5^ csq6uuflu5l6i51(!5r5gj .^GUiGor^gj ff,6sf\ff,§ieuiDnem 5iigLiffi«n6Tru-|Lb LSlrfl^Q^©ffiglfr)gj. 3. (Lpiq-fflJI^efTSTT g60f1g§i£UL£irT£OT ain.gUft6OT6TTg glcrgiULJ) ^ @ J U L ] g ] n O g J . (ii) Describe the usage of built-in methods in set data structure in Python. L I ULUggrurrLGOTL G^SlGiirflftftGijib.

0 eligible source papers

Write a function def compute_student_statistics(details) that performs the L3 (b) following: (i) 1. Computes subject-wise statistics across all students (for subjects: 'phy', 'chem', 'mat', 'py'), including: Mean, Median, Standard Deviation 2. Returns: A separate dictionary with the subject statistics L5l6OT6ii(r56ii«5T6iifi)«nfDff QffUJLLjLb eg® ffnriJGJnu def compute_student_statistics(details) GrcLpgjriiasGtr: 1. ^GOTGOT^gi LDrTGOOTGUijffiGrfl^Lb (urri_rnjR(GT5ffi@: 'phy', 'chem', 'mat', 'py') u f T L GurrrflujrTGOT L|GtTGTflfl5l6uijrnjffi«DGrra ffi«3OTftSl©Spgi, g l ^ G l ) : 8=grT5=rfl, ffrjrrffrfl, r^eo^GUUJrran" oSlGuaGU 2. g l ® L b u u Q u g u ^ s b : u n L - Lj6trGrfl«5lGuijr5je5(GT5i_6(Jr eg® ^gofl ^ a i j r r g l Example Input Dictionary: details = { 20241110: {'name': 'Khan', 'age': 18, 'ass1':{'phy':88, 'chem':99, 'mat':99, 'py':99}, 'ass2':{'phy':88, 'chem':99, 'mat':99, 'py':99}}, 20241111: {'name':Sam', 'age': 18, 'ass1':{'phy':81, 'chem':79, 'mat':99, 'py':89}, 'ass2':{'phy':80, 'chem': 89, 'mat':79, 'py':79}}, 20241112: {'name':'Ram', 'age': 18, 'ass1':{'phy':68, 'chem':79, 'mat':89, 'py':99}, 'ass2':{'phy':58, 'chem':69, 'maf:79, 'py':99}} } Output Dictionary: { 'ptiy': {'mean': 77.2, 'median': 81.0, 'std_dev': 13.4}, 'chem': {'mean': 85.6, 'median': 89.0, 'std_dev': 12.2}, 'mat': {'mean': 91.6, 'median': 99.0, 'std_dev': 9.3}, 'py': {'mean': 94.0, 'median': 99.0, 'std dev': 8.5} } (ii) Describe the built-in methods in dictionary data structure in Python. 6 3 L I

0 eligible source papers

Write a function def merge_vowel_lines(f1, f2, f3) that: 7 4 L 3 (a) 1. Takes a s input arguments two input files (f1, f2). (i) 2. Filters out only the lines that start with a vowel (A, E, 1, 0, U or a, e, i, o, u) from e a c h . 3. Merges those filtered lines into a third output file (f3). 4. Display the contents of the third file (f3). merge_vowelJines(f1, f2, f3) CTSOrrD ffnijgOTU CTCLp^ojih, ^ g i : H 1. glljeOOl© ^6fT6Tfu® (§an-UMft«D6TT (f1, f2) 2_6n"6TfL0 6Un^rnJS56TTrTffi o CT© ^ §) ffi Q ffi FTGrr gl no § j . 2. @6ijQairT6OTn:5l661(r5[BgiLb 2_U51QIJ(!-P^§JL_6OT Q^n"i_r5J(gLb en\f\&€iDen LDL©Lh 6UL^ffiLl©SlfDg) (A, E, 1, 0, U c^susugi a, e, i, o, u). \ 3. ^ [ 5 5 G U L ^ f f i L L U U L L 6Urflft6?n6TT ^6OTfprT6U§l QGUGTflulL© GffirTULSlGU (f3) glGOTfeOOiftglrDgi. 4. Qp&JrnDrTGUgi Q&nu\3ei5T 2_6fT6TTi_ffiffirBja6m6TT<K ffirru©glfDgj (f3). (ii) Discuss the different file handling functions in Python. 6 4 L I emu^^rrGcflGU 2_6rT6TT ueixSGUgu CffirruL] cjnssajrrcgTj^Gb QffuJ6uurT©ffi60)GrTLJ urboJl GiSleurrglaaeijLii.

0 eligible source papers

Write a Python function def get_valid_userJnfo(name, age, email) that takes a s 7 4 L 3 (b) input their name, age, and email. The function should validate the following: (i) 1. name must be a non-empty string and contain only alphabetic characters and s p a c e s . 2. age must be an integer and be between 17 and 21 (inclusive). 3. email must contain exactly one '@' symbol and end with a valid domain like .com, .org, or .net. if any of the inputs are invalid, the function should raise a ValueError with a descriptive m e s s a g e and prompt the user again until all inputs are valid. Use try/except blocks to handle exceptions and demonstrate user input handling. The function returns True if the inputs are valid and False otherwise. ^ajij(R6Tfleor Q u o j r j , GUOJg) inrbguLb uSlGcreurc^fiFGi) (Lpffiairflsnuj 2_6fT6TfL_rrffi CT©^§lffiQarrGtT(6T5Lb 6g(l5 6OTU^IT6OT QffUJ6UUrril6OTI_ def get_valid_userJnfo(name, age, email) CT(Lp§jrHJft6TT. Q f f u j e b u r r © L5lGOTQJ(f56II6OT61irb6!np ffrflumjffia C6UfcOOI©LD: 1. Q u u j i j 6g([5 Qsupgu a^rrLDrrsB g l o e s a (S6U60oi©Lb LurbguLh ^arreurflewa^ CT(i-p^gjaassTr LDrbgULb giSOTLQaiGrflftRDGiT LDL1©(SLD QffirrfaoorLq.([5ffiffi (Seubooi©Lb. 2, euLugj 6 ? ® (Lpcip CTeweoOTrras gl®ffiffi GeueoOTCglLi) mrbsum 17 (tpgeu 21 3. Li5l6OT6ar®ffG6lGl) ffcfliurra eg® '@' &mm[h g l ® a f f i G6iJ6obr©L£i LQfDfilJLh .com, .org, ^ G U G U g i .net Gurreorp Qs=6U^ULii.ujrr@Lb Qi_rr6!nLDgui_eOT (LPLq.6U6?ni_UJ G6U60OT(blLb. eg® «51sTTffiaLDn"60T Q5^LLJ@LL|L.6OT eg® ValueError g CTCLpuiJ], ^ « D 6 O T ^ § I 2_6TT6Tf©as(GT5Lb Qff6Ug^uii).ujrr(g±i eusOTij UUJ6OT6OTIJ uJeoor^LD GssLffi Gai60OT©Lb. «51gl«5l6Uffi@ffi6in6rTffi 6inaUJn"6TT61|Lb UOJeOrij 2_6TT6TfLl© «r)ffiUjn"(g[5^6m6V) {^©LJlaaeijLb try/except blocks g i j uuJ60TU(Sl^a56i|Lb. 2_6tT6Tf©ffi6tT QffGUgjJU Lq.ujrrffi gl®rb^rTeu Q5=UJ6UurT(bl True gU-|Lb @6U6OT6uQLU6gf]6l) False ^LLjLJb 6ULprnj@g)pgi. (ii) Discuss any three exception handling constructs in Python. L I

0 eligible source papers

At a metro station, passengers order up at a ticket counter. One at a time, the ticket L5 (a) counter serves each person. Also, provide provision for passengers with emergency (i) passes are moved to the front of the order. 1. Use an appropriate data structure to store passengers: "Alice", "Bob", "Charlie". 2. Simulate serving each passenger. 3. Print the data structure after each person is served. 4. Add 1 emergency passenger who should be served first and demonstrate by printing the data structure. eg® QuDilGp'n" r^6?ncuuj^@6b, uuj60oflffi6TT eg® L!:).ffiQffiu ffia|soun_rfl6U QffiiiSlprrijffietT. eg® Grgij^gleu, Lq.aQffiL ffi6i]60OTi_FJ egdjQeurr® r5u®ffi(gLb GffRDSu Q f f u j S l p g i . Gmg^m, ^GUffrrarreu unero&en 6U<F@6inuj 6ULprnjffi6i|Lb. i 1. uuJ60uflffi«n6fTff GffLiSlffiffi Qurr®^a5LDrr6or ^rjo.] ffiL.L_60)LQU6!nuLJ uujsOTu©^56ijLh: "^siSlsR)", "urrij", "ffrr(J6iSl". 2. egeiiQairr® uuj605fl<5@i±i Ga^e^neuecnuj 2_®6u<gBuu©^gjrnjftGTT. 3. egdjQeuR"® r s u ® K @ L b Ga^SOTOJ Q C F U J U J L J U L L l i l p ® ^rjeij ^SOTu^uemu 4. (LP^GlSlsb Gff«nSU Q f f U J U J l J U L GSUSCOTII1.UJ 1 ,=^611S=IJ UUJ6OTfl6OTUJff G f f l j ^ g J , ^ I J 6 I | aLI_6g)LQU6g)U ^ffg1(gl£lJ^6gr gLpSULD f^gr^LJ]aa61|Lb. (ii) Discuss the above problem and the problem solving techniques used in the above L5 solution. GU3G6U a_6iTGTT ^ftffiGOTGULLjLb, GLDGGU 2_6tTSrT §[JQ51SU U U J 6 O T U © ^ ^ L J U ® L D

0 eligible source papers

At a supermarket, you are building the checkout system for a new self-service L5 (b) vending machine. Customers can insert coins of different denominations to pay for (i) a product. However, the machine should always try to return the minimum number of coins as change to the customer. Write a function def min_coins(coins, amount) takes list of coins and the amount as inputs. The function determines and returns the minimum number of coins needed to make up the given amount. If it's not possible to make change using the available coin denominations, return - 1 . eg® u6uQurr®6rT ^fiiftrriH-UJlsl), jgrsiftstr eg® i_|g]uj a-uj GiFemai a_(!5airT(S@Sl(]5'ijftGiT. ojrri^ffigffiaujrrsTTijffietT eg® ^ L u r r c f l u L i a ® UGOOTLD Q f f g i J ^ ^ QOSSnQGiiQi LDgllJL^GiTGTT rsrTGODTLUrSJaSOieTTS: Qff®ffi6Un"Lb. gl®uL51guLi), giuJiBgl[j±) CTuGurrgiLTi © a n n o p ^ u L f f 6T6obr6aoflas60)a5uil6urT6or rBrreoorLuraflsgmGrr 6urTii).ft6ff)aLurT6n"®ffi@ LnrTfbnDLDnra^ @®LJL51^ ^ F J CLpLurb^ffia GojeobrCblLb. egcjj Qs= ID6burTil60)i_ CTCLpgjrajffiGTT def min_coins(r5rT60orLUfHja6tT, Q^rrgma) rsrrgoorujrnjffiGTfleor ULl4UJ6016UU-|Lb a_6TT6Tf©fteTTrTffiSl|Lb 6T©^§l<KQasrT6TTSlnDgJ. Q5SrT©ft(5LJULL_ Q^rT60)a560)UJ rf(5lQffLLJlU 60)6ULUrT60r @60)fDrS^ULff 6T6Dbr60oflaGO)aii5l6urT6or !BrT60orujrnja6O)6iT Q f f u j e u u r r © ^iJLDrreoflggi eULprnJoSlrOgJ. ©60)L_Rffiffi(ffin.l4.UJ LDglLJL|6tT6TT IBrT6D0rLUrHJffi60)GTTLJ ULU6oru(b1^gl LDrrrbnoLb Q-FLULU cLpui.ujrT6)5lLi_rT6l), -1 g 1 ® U L 5 1 ^OTtJLJU61|Lb. Discuss tlie above problem and the problem solving techniques used in the above L5 solution. G L B G G U 2_6tTGTT ^ffiR60)6UU^Lh, G L D G G U 2_6tT61T gljo^fil) u u j 6 o r u © ^ g L J u 0 L h ^ffissGu g i j a @ L i i ®JLlufnjffiG0)6rTU-]LjbI

0 eligible source papers

operations (addition, subtraction, multiplication, and division). The module should: (i) 1. Define a function calc(f, a, b): o Accept a function f (such as a lambda for an arithmetic operation). o Accept two operands a and b. o Return the result of applying f(a, b). 2. Define the arithmetic operations using lambda functions. 3. Validate user inputs: o Ensure the operands a and b are valid numbers. o Handle exceptions gracefully (e.g., invalid input or division by zero). Provide a menu interface that allows the user to: o Select an operation (add, subtract, multiply, divide). o Enter the operands a and b. o Display the result of the operation. o Allow the user to continue using the calculator or exit the program. 5. Use a loop to display the menu until the user chooses to exit. 6. Demonstrate the usage of the module by writing a test program. cgHl^LJU60)l_ GTSObrSSeOOfl^ Qa^LU6UUrT(Sla60)6rT (8in.LI_6b, ftL^^^sb, Q u ® ( K a 6 U LOfbguib 6U@^56l)) 6iiLpr5J@Lb calculator.py ergorro eo)u^rr6or Q s r T @ @ 6 0 ) i u CTCLpgirHJffiGTT. Q ^ r r @ g l lileoreu^LDrTgij g ) ® a f f i G6U6obr®L£): 1. eg® QffLU6Uun-L60)i_ calc(f, a, b) QJ60)ijuJgiJass6ijL£): - eg® QffUJ6UurrLL60)L- f (eg® CT6obrss60ofl^ Qfl=uj6UurrLiii.rb(Krr6or cunLOLn GurreornDoneu) errbguaGlarrGtTGrreijLb. - girreobr© QffUJ6uurr(blffi60)6TT a uDrbfiULo b g"fbguffiQsrT6tT6iT&i|Lb. - f(a, b) g L J uuj6dru(bl^©i6U56or (LpLq.eo)6u^ gijajLQ. 2. 6urrLbi_rr QffUJ6burr(Sl(g560)6TTU u u J 6 o r u ( S l ^ @ CTgobraeoofl^ QffUJ6UUrT(SlaS016TT 6U60)gUJ®Jffift61|Lb. 3. u q j s g r i j g.gfrGTfjglasmen'ff .yrflumjaasi^Lii: 7of8 - QffLueburT©a56tT a LDrbguib b Qff6bg^uiii.ujrT@Lb 5i6ms,m 6T6OTU6jn^ 2_gU U U © ^ ^ 61J li). -ffl51@6i5lGua@ffi6in6Tr^Lpftrrflsffi gtnflSLurTerreijLb (CT.arr., ^Guprreur g-Grrerf© ^euGugj y,^^LU^£5rr6u &ij@^^6b). 4. uuj6oreo)ij ^@ULQ@<g5@Lb QLD@U gi60)i_(ipffi^eir)^ euLprnjaeijLb: - eg® QffUJGUurTLGOTu^ (Sgijr5Q5©ffiffiei]Lb (G£FIJ, S S L ^ ^ ^ G U , Qu®ffift6b, - Qa^uj6burr©as6fT a iDrbguLb b g 2_6fT6Tfli_ajLb. - QffLiJ6burTLlii}.6cr (Lpu^Rneua a r r L © . - uojeorijffin"6lj@(S6ULL_«r)ijLJuuj6ijru©^§i6uan5^ Q ^ r r L i j 5. umecrij Q6U6rfl(Sujp^ S^iJ!BQ5©(S@Lb euemij QiDegisOTSiiffi ffirrgouTLilaa eg® 6116OT6TTUJ^6OT5U UUJ6OTU©^561J±). 6. eg® GffiT^eOTGOT r^ijeinGU CT(ipgjQj^6OT ^ G U L D G\ff,n(g,§\uS\m uiu6OTurTLl6OTi_ r^eiBLJlafteijLb. (ii) Discuss the advantages of your above solution design. 5 1 L2 (Sm(S6u a_GTT6rT s^rms^en grjeij euKt-OjetnLDULilecr i5^6S)[ris>€iS)mu urba51 Q5l6urr@ffiffi6ijLb. t

0 eligible source papers

Advanced Examination Analysis

Historical analysis based on extracted question papers. Topic classifications, marks and planning estimates are provisional.