Explanation:
the slope of a line is the ratio (y coordinate change / x coordinate change) when going from one point of the line to another.
in short
y diff / x diff
now, in a vertical line x never changes at all.
such a line is the combination of all points with the x coordinate = c.
so, x diff = 0
and we have as slope
y diff / 0
a division by 0 is officially undefined and sometimes symbolized as infinity.
I am not sure what your convention with your teacher is to write this as result.
the main options I see are
y/0
undefined
infinity