If you print a message in that conditional statement it will print any time that it is true. It will be true the entire time that you are holding the button down (remember that it will execute really fast so what you may think is a single press is actually a long time relative to the computer).
If you only want the message to show when you first press the button then you need to save the previous value and compare it to the current value to detect the change of state.
If you search you can find all the information you need. Amazing how that works.