Preventing the Collapse of the Universe

Published by Matt in

Dividing by 0 is a huge mistake and should be avoided at all costs.

Create a function that when given a math expression as a string, return true if at any point, the expression involves dividing by 0.

Examples

catch_zero_division("2 / 0") ➞ true

catch_zero_division("4 / (2 + 3 - 5)") ➞ true

catch_zero_division("2 * 5 - 10") ➞ false

Notes

Multiplication signs will be given as an asterisk *.

Watch a quick demo on how Edabit works.