Stop the Account Going Negative
Fix a class method so it refuses withdrawals it can't cover.
A intermediate Linux challenge worth 10 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.
The Challenge
Scenario: /home/labuser/lab/bank_account.py defines a BankAccount class whose withdraw() method always succeeds, even when there isn't enough money - a real account should never go negative.
Task: Fix withdraw() so it returns False and leaves the balance unchanged when the amount is too large, and returns True and subtracts it otherwise. result.txt must read balance=40 ok1=True ok2=False. Run check when ready.