A horizontal line has zero slope. A vertical line has an undefined slope.
x = -8 is a vertical line, so it has an undefined slope.
y = 2 is a horizontal line, so it has zero slope.
x = 9 is a vertical line, so it has an undefined slope.
y = -9 is a horizontal line, so it has zero slope.
I hope this helps with your homework. Have an awesome day! :)