The slope is defined as the ratio between the difference of the #y# components and the difference of the #x# components of a given pair of points on a line.
In other words, given a line, pick two points #P_1 = (x_1,y_1)# and #P_2 = (x_2,y_2)#, the slope #m# is defined as
#m = \frac{y_2-y_1}{x_2-x_1}#
In your case, the line #x=7# is composed, as the equation suggests, by all the points having the #x# component equal to #7#, and any #y# component. So, two points on the line have the form #P_1 = (7,y_1)# and #P_2 = (7,y_2)#
Can you see the problem? If we compute the slope, we have
#m = \frac{y_2-y_1}{x_2-x_1} = \frac{y_2-y_1}{7-7} = \frac{y_2-y_1}{0}#
And you can't divide by zero. This is the reason why all vertical lines (i.e. those with equation #x=k#, for some real number #k#) have no defined slope.