Unity says: " Unexpected symbol `else' "

I’m trying to make a sprint for my 2D game, but no matter what I do, unity keep saying " Unexpected symbol `else’ ", please help me.

script (C#):

bool isSprint = false;
public float speed = 10f;
public float sprint = 2f;

(…)

anim.SetFloat ("Sprint", Mathf.Abs (isSprint));
if (Input.GetKeyDown (KeyCode.LeftShift))
	speed = speed * sprint;
    isSprint = true;
else if (Input.GetKeyUp (KeyCode.LeftShift))
    speed = speed / sprint;
    isSprint = false;

You need to use braces {} around code blocks. You can’t just use whitespace (unless you use Boo instead of C#).

If you don’t use braces after your if statement, only the first line will be considered part of the if statement.

So what you really wrote, as far as the compiler knows, is:

if(Input.GetKeyDown(KeyCode.LeftSift))
  speed = speed * sprint;
// END OF IF STATEMENT
isSprint = false
else if(Input.GetKeyUp(KeyCode.LeftShift))
  speed = speed / sprint;
// END OF ELSE IF STATEMENT
isSprint = false;

Since the if statement ends, and there is another statement after it, the compiler has no idea what to do with that ‘else’
Instead, try:

if(Input.GetKeyDown(KeyCode.LeftShift))
{
  speed = speed * sprint;
  isSprint = true;
}
else if(Input.GetKeyUp (KeyCode.LeftShift))
{
  speed = speed / sprint;
  isSprint = false;
}