Loading...

The Account Manager

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
mid, senior

Problem

Implement a BankAccount class with an initial balance set in the constructor. It should support deposit(amount) and withdraw(amount) methods. Withdrawing more than the current balance should raise a ValueError. Include a balance property.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.