Quiz: Object-Oriented Idioms

Quiz on object-oriented idioms.

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

Question 1 of 80 attempted

Get hands-on with 1400+ tech skills courses.