Play animation if 2 buttons are held down?

SO i got this script off a question , i dont own it … but i want it so if im holding down w AND left shift , my sprint animation plays , and if im only holding w then my walk animation plays - its for an FPS game … OH and also i want the animation to KEEP playing UNTIL i let go of shift and/or w . Thanks guys

if(Input.GetKey(KeyCode.W))
    animation.Play();
else if(Input.GetKeyUp(KeyCode.W))
    animation.Stop();

Here, try using a switch setup,

switch(true)
{
	case Input.GetKeyDown(KeyCode.W) && Input.GetKeyDown(KeyCode.LeftShift):
        // If you've pressed W and LSHIFT
		gameObject.animation = runningAnimation;
		break;
	case Input.GetKeyDown(KeyCode.W):
        // If you've pressed W
		gameObject.animation = walkingAnimation;
		break;
}