Challenge 2: Class Attribute Counter — Possible Solution ==================================================================== class Robot: count = 0 def __init__(self): Robot.count += 1 r1 = Robot() r2 = Robot() r3 = Robot() print(Robot.count) Output: 3 WHY THIS WORKS AS AN ANSWER ------------------------------ count = 0 in the class body reuses this chapter's own class-attribute definition pattern (like species = "Canis familiaris" in the Dog example) — a single value that belongs to the class itself, not to any one instance. Robot.count += 1 inside __init__ deliberately updates the count through the CLASS name (Robot.count), not through self.count. This matters: writing self.count += 1 would actually read the shared class value once, then create a brand-new INSTANCE attribute on that one robot shadowing the class attribute — leaving the real shared count untouched. Going through Robot.count explicitly avoids that trap and correctly updates the one shared value every instance reads from. Since integers are immutable (unlike the warn-box's mutable tricks = [] list example), reassigning Robot.count with += is a safe, ordinary use of a class attribute — it's being used as a simple shared counter, not as a container that gets mutated in place. Creating three Robot instances runs __init__ three times, incrementing Robot.count from 0 to 1, 2, then 3.