Button Pressing

UKHeliBob:
Did you get any error messages when you compiled it or just no output ?

How are the inputs wired ?

They way its wired is fine the problem is when I copied and pasted

//if the button on pin 3 is pressed
if(digitalRead(3)==LOW){
//Send the message
Keyboard.print("World!");
delay(1500); }
}

It gave me

sketch_nov14b:25: error: expected unqualified-id before 'if'

if(digitalRead(3)==LOW){

^

sketch_nov14b:29: error: expected declaration before '}' token

}

^

exit status 1
expected unqualified-id before 'if'