A line with no slope will be parallel to the y-axis, because a line with a slope of undefined means that the x-ordinates do not change in relation to the y-ordinates.
By using the gradient formula,

, your x₁ and x₂ will yield the same value, thus forming a zero denominator.
As such, a vertical line will always have an undefined gradient, meaning that it has no slope at all.