Build a BankAccount Tracker

Medium State Management (Variables) PRO
🔒 Login to Unlock

Problem Statement

Build a `BankAccount` class. Use a class variable `global_funds = 0` to track all money in the bank. Use an instance variable `balance = 0` for individual accounts. Method `deposit(amount)` increases both. Instantiate two accounts, deposit an amount into each, and print their balances and the global funds.

Input Format

Two space-separated integers for deposits into Acc1 and Acc2.

Output Format

Print each balance on a new line, then the global funds.

Constraints

deposit >= 0

Sample Input

50 100

Sample Output

Acc1: 50
Acc2: 100
Total: 150

Explanation

Perfectly demonstrates managing isolated instance state (individual balances) while aggregating data in a shared class state (global funds).

Starter Code

class BankAccount:
    # Define variables and methods
    pass

if __name__ == '__main__':
    d1, d2 = map(int, input().split())
    # Instantiate accounts, perform deposits, 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