SOARDO
Software Engineer (SDE)pythonbeginner3 interactive MCQs in app

Classes, Objects & __init__

instance attributes (self.x) vs class attributes__init__ initialization and invariantsmethod self binding

Classes bundle data attributes and cohesive behavior via `__init__(self, ...)` and instance methods receiving `self`. Attributes defined inside `self.attr = ...` belong to each object instance, whereas attributes directly in the class body are shared across ALL instances!

putting `scores = []` at class level shares one list across every `Student`; assigning `self.scores = []` inside `__init__` isolates each instance.
confusing class vs instance attributes (especially mutable lists/dicts on the class body) or mutating state without validation.
Python Classes (Official)read ↗Exercism Python Track (Interactive)practice ↗

Practice Classes, Objects & __init__ with 3 graded MCQs & written feedback.

Take SOARDO’s free 12-question diagnostic to see how strong you are across your target role and unlock adaptive daily missions.

Test yourself free on SOARDO →View full Software Engineer roadmap

More Software Engineer Study Guides