You are on page 1of 13

Deep Dive - Functions, OOPs, Modules, Errors and Exceptions > Python Quiz Ill


Predict the output of the be low code S1
1

ppef
FJl1
class A:
def _ init_ (self):
I 11 1

print("he") "i I

def method2 (self):


print(''1 ")
self._in it_()

class B(A): ~
def method1 (self):
super() ._in it_()
self. method2 ()
B() .

• he
·1
he
2
B() .

• ,
he

he
2 !i\

he
he

hie
2
Deep Dive - Functi

c-·-
.::)
2
fl~

c·•.,
✓ l
•.,_./
2
Ill'
•• - - ••• - .........., " '\:,: Ill

self.method:1 1

pri nt("2 1
')

class C(B,A):
pass
C().method1 ()

2) 1

2)2
1

• Error: rvlaxirndm recursion depth exceede_d

-"
\...✓) 2 infinite t 1~1es

<O> VIev etr.J aiiat1on


111111

111
"11 1111111111'

1,111ll !ll1[i[1li11:/l!/111ili!lil
1 1

Ji/i 11
1///1,:'',
- def
d rps,**keyargs)t
i/fllr .

~enf=a 1
'1

r~~Ur 'II ed_argum


r,et '

@fw
def func~

• 8 Hello
Python
Edureka
200

• . , He llo
Edureka
Python
200

~ - -~-~~ ... -.. "1- 11 :¾fl:\1~ ~t1 T~l~ll 1P


1
(
1 1
- - ----

., " I ': ~,11 I 11, 1111 I f,, I ,1:


1
Deep Dive ~ Functions, 00 Ps, Modules, Errors and Exceptions > Python Quiz 111
111111111- !.~,

a=100

t(a)
bail a
00
,~()
)

lllllil, 1111 1111 111

111 •• • ,, I Ill 1 1 1,1l 1 II

(~) 200

11

I'll

I/IHI
1
1,1



• Error rn lmport 'staternent l;if ii
)!f 'Ii
jfl

1 '11• ill 11'' lllill!III illl II ll•I'


" II '"' 11 •1iilli'' ,Ill ill' I , '


11'1111111 l'I
111"' 'Ill
v,ew rxpl<'1r1at11n
,""111-...,.,,,,..,,,,.1111.....,,,.,.111111,nnm,H1lil1nnniliii'_ __,.,...,....,,,,,...,...._

'I 'Iii i ii! 111111 11 Ill

'(m,,1/I ,, 'lll111 . lll!1''[111111111

ill 11!!\i'I 1
lit Ill . , 111111111 11111111

,iii Ill I ! ,1 1 Ill, Ill ii ' l'I 111

'II fl

i1+:n, i, '1,11

t 0
1
• True:
False
Ill 1i!ill 111
• • PredJ(;i th.!: c,mput;
c1ai,; A;
dttf J ni!_ f ,~ t~f
• primJ , ': rf)
dr•f r,, ,::1ir '/Yi',,~ fi
• >(tr ,. (' i'1y
.Ci t; (.,<, =~
• .A: ,:,,/
f J c;
If /ti,,,,
-,
/, (,
·=-l , ,
" ~,.
'I "


Choose
plass

l 'II jl •
11
:i:ill' ·
,' 111


Ill 1

111 iiiill "

m 111:II 111111 1li

Ill 11111111111,111

11
111l1iill 1111111\111 111111
'Ill

111 111
11111 111 11111111111111 '111 1

11
· 111111 1111 Ill 'I 11111\111111111

i11 lli1111 Ill I 11


111 I
1,11rn~1nrririn 1rir,
1
IIIJ ,11 lllfff l l
1

11111 lff 11111 Ill i111 11111 III II 11111111111 Iii 111111

1
1111111 11111111111111111 1 1
1

11111lll1lll . 1111lllll
11
lllll 1: IIIIII Ill

I Ill
111
1111 (dl1 i ll/11
111
II

1111

1111

11111

11
111

111111[1111

( ~ ) Ill ,~•
a2=A(40)i
A. X=200

You might also like