A vertical line has a big rise and no run, so its slope would be something divided by zero, which is mathematically problematic. The way we say this is:
slope of a vertical line = undefined
In other words, in the process of trying to find it, we inevitably break the mathematical law, so we can't give a sensible numerical answer.