OOP
2 / 10
EasyOutput prediction

Class vs instance attribute lookup

What does this code print?

class Counter:
    count = 0

    def __init__(self, n):
        self.count = n

c = Counter(5)
print(Counter.count, c.count)

← → arrow keys to navigate

Sign in to save your progress.

Class vs instance attribute lookup - Python OOP Quiz | Unnested