You can put this solution on YOUR website! Any two points on a horizontal line have coordinates (a, b) and (c, b). The slope is then equal to , given a is not equal to b.
Any two points on a vertical line have coordinates (d, e) and (d, f) (assuming e not equal to f). The slope is then equal to = undefined, because division by 0 is impossible.