Given the vertical line, the slope of a straight line is expressed as;

From the line, we can choose any two coordinates, using the coordinates (5, 0) and (5, 5)
x1 = 5, y1 = 0, x2 = 5 and y2 = 5
Substitute into the formula as shown;

Any value divided by zero always tends to infinity. Hence the slope of the line is undefined.
Note that the slope of any vertical line does not exist.