LearnPy Hub
← Exceptions problems
Medium

Custom Exception

Define class InsufficientFunds(Exception). Read a balance and a withdrawal; raise it when the withdrawal is too big. Print the new balance or Insufficient funds: need X more.

Input

Two integers.

Output

One line.

Sample 1

Input
1000
300
Output
700

Sample 2

Input
100
250
Output
Insufficient funds: need 150 more
solution.py
Output appears here
Custom Exception · Python practice problem · LearnPy Hub