Help a Beginer

Hai to all experts over there, Merry XMas

Ive been going through the tutorial for some time now…
the script that has been provided is great but id does not say where exactly it has to be put into…

eg:

should i put the code for a object or for the scene etc
i tried a few examples. but it is not working