Page 204 - Computer Science Class 11 With Functions
P. 204
2. Aooertion(A):n Evaluatingnthenfollowingnexpreooion:
max('Anshul', 'Mridula', 'Shekhar', 'Ashish')
will yieldn'Shekhar'.
Reaooning(R): max()ntakeononlynnumericnvalueonaonargumento.n
3. Aooertion(A):n Pythonnallowonthenconveroionnofndatanfromnonendatantypentonanother.
Reaooning(R): int() ionannexamplenofnantypenconveroionnfunction.n
Case Based Questions
1. RamannandnRiohinarenbeotnfriendo.nRamannionunablentonunderotandnthenapplicationnofnfunctiono.nHenionofnthenopinionnthatn
programonrunnoucceoofullynwithoutnfunctiono,noonwhynmakenthencodencomplex?nRiohindeveloponanfunctionntonteotnwhethernan
numbernionanprimenandnuoeonitninnanprogramnthatnacceptonannumbernfromnanuoernandnnteotonwhethernitnionprime.nHenaokonRamann
toncreatenanoimilarnprogramnwithoutnfunctiono.nKeepingninnmindnthentwonprogramo,nnnexplainnhownRiohi'onprogramnhaonannedgen
overnRaman'onprogram.
2. Noornionanretailer.nShenwantonyountoncreatenanoimplenprogramnfornhernthatnwillnacceptnannitemnname,nprice,nandnquantitynandn
calculatenthenamount.nThenprogramnohouldnhaventwonuoer-definednfunctiononaonfollowo:
n accept()n-nacceptonname,nprice,nandnquantity
n calculate()n-ntakeonpricenandnquantitynaonargumentonandnreturnonthenamountnaonpricen*nquantity.
n Thenprogramnohouldnhavenappropriatenfunctionncallonandnohouldndioplaynthenoutputninnthenfollowingnformat:
n NamenofnItem:
n PricenpernUnit:
n Quantity:
n TotalnAmount:
Multiple Choice Questions
1.n(a)n 2.n(b)n 3.n(c)n 4.n(b)n 5.n(a)n 6.n(c)n 7.n(d)n 8.n(b)n 9.n(a)
10.n(b)n 11.n(b)n 12.n(a)n 13.n(c)
True or False
1.n( )n 2.n(T)n 3.n( )n 4.n( )n 5.n( )n 6.n(T)n 7.n(T)n 8.n( )n 9.n( )
10.n(T)n 11.n( )n 12.n( )
Fill in the blanks
1.nmodularn 2.ndefn 3.nNonen 4.nfunction
5.nBuilt-inn unctionon 6.n:n 7.nargumenton 8.nvoid
202 Touchpad Computer Science-XI

