Slope judges the vertical angle in which the line is moving, from point to point. If the line is vertical in it of itself, there will be no specific point in which you can use to define the slope. The denominator of run is always 0, and having a 0 for denominator will result in the fraction being undefined. You cannot have parts of nothing, mathematically.
For this question, you have to take Least Common Multiplier for which in this case will be "45" as, the denominators can get similar and get multiplied by a same value to form a similar expression. This allows us to cancel out them by common factors. Full process shown below.