When you call Button() you get back not a number, but a set of on/off bit flags encoded into a number. If you look at the number in binary you get a 1 or 0 for each button. So when you AND it with a number or constant (Please use the #A, #LEFT, etc. constants it makes your code more readable) you are really just isolating that bit to see if it is False (0) or True (not 0) or released/pressed.