How to make an audio clip play when a key is pressed

I want to make a sound play when I press a key. when I attach this to anything it says it has not finished compiling yet.

var sound1 : AudioClip;

var sound2 : AudioClip;

var sound3 : AudioClip;

  function Update () {

     if (Input.GetKey("1")) {
        audio.Play(sound1); }

     if(Input.GetKey("2")){
        audio.Play(sound2);}

     if(Input.GetKey("3")){
        audio.Play(sound3);}
}

...

function Update () {

 if (Input.GetKey("1")) {
    audio.Play(sound1);
 }

// inside the parentheses ("sound 1") don't put quotation mark since you've defined a variable.

and also make sure that all other scripts you've made are error free. Unity does not compile codes if any of them includes mistakes and errors.