using a pushbutton to control a servo

#include <Servo.h>
Servo servo;
int pushbutton = 9;
int buttonstate = 0;
int x;

void setup() {
pinMode(pushbutton,INPUT);
digitalWrite(pushbutton,HIGH);
servo.attach(10);
Serial.begin(9600);
}

void loop() {
for (int x = 0; x <= 180; x++) {
if(pushbutton, HIGH)
digitalWrite(servo==180);
if (pushbutton,LOW)
digitalWrite(servo == 0);
}

}
please what is the error in this code and i need correction

digitalWrite(servo==180); and digitalWrite(servo == 0);

Change == to =

However, this this not the way you move you servo position. See: https://www.arduino.cc/en/Reference/ServoWrite servo.write(180); or servo.write(0); .

Put some effort into reading how to use the library. .

please what is the error in this code and i need correction

What does the code supposed to have the servo do?

Please read #7 below:

http://forum.arduino.cc/index.php/topic,148850.0.html