Question about my Sketch.

An input pin when nothing is connected (or an open switch in your case) is indeterminate, neither low nor high (i.e. bouncing in between). A pull-up resistor holds it gently but distinctly high, but allows a switch to ground to easily pull it distinctly low. The INPUT_PULLUP enables a built-in pullup resistor.

A pull-down resistor addresses the same problem in the opposite way, but there is no built-in (you would have to provide externally)....

Cheers,
John