Login and get codingIn this Bite you'll learn to catch and raise Python exceptions.
Write a simple division function meeting the following requirements:
1. When the denominator is zero, catch the corresponding exception and return zero.
2. When the numerator or denominator have an invalid type reraise the corresponding exception.
3. If the result of the division is negative raise a
ValueError
.Check the tests if you have questions about what your code needs to pass. Have fun!
397 out of 404 users completed this Bite.
Will you be the 398th person to crack this Bite?
Resolution time: ~28 min. (avg. submissions of 5-240 min.)
Our community rates this Bite 2.92 on a 1-10 difficulty scale.
» You can do it! 😌