All vertical lines have an undefined slope. Horizontal lines have zero slope, and diagonal lines have a slope.
When calculating a slope for a vertical line, you would have to divide by zero. The quotient of any number and 0 are undefined, as you cannot divide by zero. This is what makes vertical lines have an undefined slope.
The put option will be exercised only if the final price is below the strike price. If the final price exceeds the strike price, there will simply be a loss equal to the cost of the option.