Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ValueCannotbeNegativeOrZeroError(Exception):
- pass
- def validate_numbers(numbers):
- for num in numbers:
- if num <= 0:
- raise ValueCannotbeNegativeOrZeroError("Please, enter only positive numbers!")
- numbers = [1, 2, 3, 4, 0]
- validate_numbers(numbers)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement