What is wrong with this code and how do I fix it

I am trying to run 2 servos
// Sweep
// by BARRAGAN <>http://barraganstudio.com>
// This example code is in the public domain.

#include <Servo.h>
Servo myhead;// create servo object to control a se// a maximum of eight servo objects can be created
Servo mouth;
int pos = 0; // variable to store the servo position
void setup()
{
myhead.attach(9); // attaches the servo on pin 9 to the servo object
mouth.attach(10);
}

void loop()
{
for(pos = 0; pos < 100; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myhead.write(pos); // tell servo to go to position in variable ‘pos’
delay(50); // waits 15ms for the servo to reach the position
}
for(pos = 100; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myhead.write(pos); // tell servo to go to position in variable ‘pos’
delay(43); // waits 15ms for the servo to reach the position
}
for(pos = 0; pos < 100; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree

// it
myhead.write(pos); // tell servo to go to position in variable ‘pos’
delay(43); // waits 15ms for the servo to reach the position
}
for(pos = 100; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myhead.write(pos); // tell servo to go to position in variable ‘pos’
delay(43);

}
}
#include <Servo.h>
Servo mouth;
void loop()
{ mouth.write(45);
delay(1000);
mouth.write(0)
delay(1000);
} //its errors include
redefinition of ‘Servo mouth’
‘Servo mouth’ previously declared here
in function void loop()’:
error redefinition of void loop()’
void loop() previously defined here
expected ';" before ‘delay’

You can't have more than one loop() function in a sketch.
You can't #include the same library twice.
expected ';" before 'delay' is self explanatory.

Henry_Best:
You can't #include the same library twice.

You most certainly can. It will just be redundant and will only cause issues if the library is written poorly.

@xmodrocker
You can't have more than one loop, nor can you have two objects/variables with the same name. Perhaps it would be best to explain what you're trying to accomplish with this code. You should also fix your indentation (Ctrl+T in the Arduino IDE) and post code in between CODE tags.

Soda Can Quartet3 HD - YouTube this link should show kind of what I am trying to accomplish the servo myhead is the one that moves the can side to side

Tons of things wrong with the code. You really should look at more examples before trying to write a sketch. In particular you’ll need to look at the blink without delay example.

Rather than enumerating everything wrong, here’s how I would do it:

#include <Servo.h>

#define HEAD_DELAY      15
#define MOUTH_DELAY     1000

Servo myhead;
Servo mouth;
int pos = 0;
int dir = 1;
int mouth_state = 0;
unsigned long head_time;
unsigned long mouth_time;

void setup()
{
        myhead.attach(9); // attaches the servo on pin 9 to the servo object
        mouth.attach(10);
        // start at a known position.
        myhead.write(0);
        mouth.write(0);
        head_time = mouth_time = millis();
}

void loop()
{
        unsigned long now = millis();

        if ((now - head_time) > HEAD_DELAY)
        {
                pos += dir;
                myhead.write(pos);
                if (pos <= 0)
                {
                        dir = 1;
                } else if (pos >= 100) {
                        dir = -1;
                }
                head_time = now;
        }
        if ((now - mouth_time) > MOUTH_DELAY)
        {
                if (mouth_state = 0) {
                        mouth.write(45);
                        mouth_state = 1;
                } else {
                        mouth.write(0);
                        mouth_state = 0;
                }
                mouth_time = now;
        }
}