Let's make a function to divide two numbers, that's very trusting about its input:
def divide(x, y)
return x/y
end
This will work fine for a lot of inputs:
> puts divide(10, 2)
5
But not all
> puts divide(10, 0)
ZeroDivisionError: divided by 0
> puts divide(10, 'a')
TypeE...