Login and get coding
In this Bite you complete the
divide_numbersfunction that takes a
denominator(the number above and below the line respectively when doing a division).
First you try to convert them to
ints, if that raises a
ValueErroryou will re-raise it (using
To keep things simple we can expect this function to be called with
int/float/strtypes only (read the tests why ...)
Getting passed that exception (no early bail out, we're still in business) you try to divide
denominatorreturning its result.
denominatoris 0 though, Python throws another exception. Figure out which one that is and catch it. In that case return 0.
2252 out of 2303 users completed this Bite.
Will you be Pythonista #2253 to crack this Bite?
Resolution time: ~27 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 3.5 on a 1-10 difficulty scale.
» You can do it! 😌