Managing Shared Mutable State

Medium State Management (Variables) PRO
🔒 Login to Unlock

Problem Statement

Create a `Team` class with a class variable `members = []`. Instantiate two objects, `t1` and `t2`. Append one name to `t1.members` and another to `t2.members`. Print the total length of the list from the class `Team.members`.

Input Format

Two lines representing member names.

Output Format

Print 'Total Members: [length]'.

Constraints

None

Sample Input

Alice
Bob

Sample Output

Total Members: 2

Explanation

Because `members` is a mutable list defined at the class level, appending to it from *any* instance modifies the single shared list.

Starter Code

class Team:
    # Define the shared mutable list
    pass

if __name__ == '__main__':
    m1 = input().strip()
    m2 = input().strip()
    # Instantiate, append, and print
    pass

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used