Quiz: Object-Oriented Idioms
Quiz on object-oriented idioms.
We'll cover the following...
We'll cover the following...
Choose the possible correct answer(s).
1.
Deduce the output of the following program.
tuple1 = ('a', 'b', [1, 2])
tuple2 = ('a', 'b', [1, 2])
print(tuple1 == tuple2)
tuple1[-1].append(3)
print(tuple1 == tuple2)
A.
It will generate an error, as tuples are immutable datatypes.
B.
False
False
C.
True
False
D.
True
True
1 / 8
We hope ...