11 questions
Observe the code. What happens when you call C().f2()
C: f2
B: f2
C: f2
A: f1
C: f2
Observe the code. What happens when you call E().f3()
D: f3
E: f3
D: f3
E: f3
Observe the code. What happens when you call F().f2()
B: f2
C: f2
B: f2
C: f2
C: f2
A: f1
B: f2
C: f2
A: f1
Observe the code. What is the Method Resolution Order for class E? (In other words, what happens when you call E.__mro__()
E -> B -> C -> A
E -> B -> C -> D -> A
E -> B -> D -> C -> A
E -> B -> D -> A -> C
E -> B -> A -> C
Observe the code. What is the Method Resolution Order for class F? (In other words, what happens when you call F.__mro__() )
F -> D -> C -> A
F -> D -> C -> B -> A
F -> D -> B -> C -> A
F -> D -> B -> A -> C
F -> D -> C -> A -> B
print(fridge.capacity[0] is fridge.capacity[3])
True
False
print(fridge.length)
0
3
4
None
Error
print(fridge.get_weight())
57
77
250
307
327
type(fridge.capacity[1])
Fridge
Fruit
Apple
Orange
Object
Error
This
is
This
Madness
is
Madness
This
3
is
3
Sparta!
3
1
3