Uploaded by Suvini Nimthara

python 6

advertisement
1.
my; Ys%;h fun (3, 4, 5) f,i fhdod le|jqjfyd;a ,efnk m%;sodkh l=ulao@
def fun (a, b, c) :
x = a*b*c
print (x)
(1) 70
(2) 60
(3) 80
(4) 12
(5) 20
2.
My; m%ldY w;=ßka mhs;ka NdIdjg wkqj jerÈ m%ldYh f;darkak
(1) Mhs;ka y÷kajkhka wlaIr ixfõoS fõ
(2) Mhs;ka j, Ndú;d jk uq,a mo y÷kajk kdu i|yd fhdod .; yel
(3) Mhs;ka l%uf,aL iq/lSug .py f.dkq È.=j Ndú;d fõ
(4) y÷kajkh ;=< @, $, % hk ixfla; wka;¾.; úh yel
(5) mhs;ka ys nyq újrK i|yd ‘’’ hk ixfla;h fhdod .kshs
3.
print ( “I am nimal \n Perera”) f,i fh¥ úg m%;sodkh jkafka
(1) I am nimal
(2) I am
(3) I am nimal
(4) I am nimalPerera
(5) I am nimal Perera
4.
y=0
while y < 50 :
break
print (y)
by; fla; LKavfha m%;sodkh l=ula úh yelso@
(1) 0
1
2
3 ……
(2) 0, 1, 2, ……..
(3) M%;sodkhla fkdue;
(4) 0
(5) By; fla;fha fodaIhla mj;S
5.
x = [2, 3, 2, 2, 2, 4, 5, 2, 3, 2, 1, 6]
x. count (2)
by; LKav ls%hd;aul jQ úg m%;sodkh l=ulao@
(1) 6
(2) 7
(3) 12
(4) 5
(5) error
6.
10 % 6 / 2 * 3 – 5 * 2// 4 w.h jkafka
(1) 4
(2) 4.0
(3) 0.5
(4) 3.5
(5) 10
7.
x = “SunilPerera”
x [ : 3: ] m%;sodkh l=ulao@
(1) nilperera
(2) SunilPerera
(3) ier
(4) sun
(5) |Perera
8.
my; m%ldY w;ßka jeros m%ldYh f;darkak
(1) f;jk mrïmrdfõ Ndú;d jQ NdIdjka high level language f,i ye|ska jQ w;r python, pascal
NdId fï hq.hg wh;a fõ
(2) m<uq mrïmrdjg fojk mrïmrdjg idfmaCIJ Wmfoia ,nd oSu yd fodaI y÷kd .ekSu
(3) iïmdol i|yd jeä u;l m%udKhla wjYH jk w;r w¾: úkHdil i|yd Bg wvq u;l
m%udKhla jeh fõ
(4) int, float, string, tuple fyda list o;a; m%reM tuple tlla ;=< wka;¾.;h úh yel
(5) ia:dkSh úp,Hka ys w.h j,x.= jkafka wod< YS%;g ;=< muKs
9. my; fla;kfha m%;sodkh l=ula o@
a=1
b=0
while a < 5:
a = b = a +1
print (a)
(1) 2 3 4 5
(2) 1 2 3 4 5
(3) 3 4 5
(4) 1 5 6 7 8
(5) 0 1 0 2 0 3 0 4
10. my; fla;kfha m%;sodkh l=ula o@
a = ‘welcome to this site’
print(a.replace(‘w’, ‘d’))
(1) welcome
(2) delcome
(3) come
(4) dcome
(5) Error
Download