A mechanical push switch relies on 2 metal contacts touching, in computer terms it will show many button presses from 1 real press..
1. In your code simply wait until contact/button Is pressed and wait about 300ms or longer so that the button is not touched by the end of the delay...
2. A debounce circuit... (several ways)