Successful withdrawal
Input
withdraw_and_get_balance(100, 30)
Output
70.0
Withdrawing 30 from 100 leaves 70.
Full lesson preview
Practice accessing and updating a protected attribute from a subclass to implement behavior.
Problem statement
Task
Examples
Input
withdraw_and_get_balance(100, 30)
Output
70.0
Withdrawing 30 from 100 leaves 70.
Input format
Output format
Constraints
Samples
Input
withdraw_and_get_balance(50, 60)
Output
50.0
Attempting to withdraw more than the balance fails and leaves balance unchanged.