Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a class BankAccount with deposit and withdraw methods.

Medium

Problem Statement

Create a class BankAccount with deposit and withdraw methods.

Sample Input

Initial Balance: 1000, Operations: deposit(500), withdraw(300)

Sample Output

Balance after deposit: 1500
Balance after withdrawal: 1200

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
# Predefined initial balance and operations initial_balance = 1000 # Your logic here
Log in or sign up to run or submit your code.Log inSign up
Input
Initial Balance: 1000, Operations: deposit(500), withdraw(300)
Expected Output
Balance after deposit: 1500
Balance after withdrawal: 1200