Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumPythonclassmethod vs staticmethodSingle-choice MCQ

A class attribute count starts at 0. Sub inherits from Counter and Sub.inc() runs once. What is the value of Counter.count and Sub.count afterward?

class Counter: count = 0 @classmethod def inc(cls): cls.count += 1 class Sub(Counter): pass Sub.inc()