__str__ of its own. Its child class, for markers, gives one.
class Pen:
pass
class Marker(Pen):
def __str__(self):
return "marker"
p = Pen()
m = Marker()
Which of these give True? Choose every correct option.One or more options are correct. Tick all the correct ones: a wrong option costs marks, and a part-right answer earns part of the marks.
Log in to join the discussion.
Loading…