Python 3
Python 3
■
Predict the output of the be low code S1
1
ppef
FJl1
class A:
def _ init_ (self):
I 11 1
print("he") "i I
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
-"
\...✓) 2 infinite t 1~1es
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
@fw
def func~
• 8 Hello
Python
Edureka
200
• . , He llo
Edureka
Python
200
a=100
t(a)
bail a
00
,~()
)
(~) 200
■
11
I'll
I/IHI
1
1,1
•
•
• Error rn lmport 'staternent l;if ii
)!f 'Ii
jfl
•
11'1111111 l'I
111"' 'Ill
v,ew rxpl<'1r1at11n
,""111-...,.,,,,..,,,,.1111.....,,,.,.111111,nnm,H1lil1nnniliii'_ __,.,...,....,,,,,...,...._
ill 11!!\i'I 1
lit Ill . , 111111111 11111111
'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
Ill 11111111111,111
11
111l1iill 1111111\111 111111
'Ill
111 111
11111 111 11111111111111 '111 1
11
· 111111 1111 Ill 'I 11111\111111111
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