transform.rotate only 1 time for 180 degrees?

Can somebody give a link or help me! How to make transform.rotate for only 1 time in .Js ? So it will be only one rotation, instead of endless moving or GetKey() moving!

I would be grateful for any kind of help!

Yes, but how to make it smooth-slowly? not instant (for helicopter rotation)?

you can use GetKeyUp or GetKeyDown. and if you want this just one time you can create a boolean variable for example
var turn = true;

if(Input.GetKeyDown.(“w”) && turn == true){
//rotate script here
turn false;