← Back to challenges

Valid Division

PythonHardmathvalidation

Instructions

Create a function that takes a division equation d and checks if it will return a whole number without decimals after dividing.

Examples

valid_division("6/3") ➞ True

valid_division("30/25") ➞ False

valid_division("0/3") ➞ True

Notes

Return "invalid" if division by zero.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Converting Dictionaries to Lists