problem in accessing values from python correctly

hello ,
my goal is to take a specific value as an input from the user (using python) and by using serial communication , i want this value to be read by the arduino uno and be applied on a motor as its speed .
but i am facing a problem in reading this value by the arduino , i guess it is not reading it as i want from the python.
so what is happening? and what i should do to take this value as it is from the python?

void loop()
 if (Serial.available()>0)
  speed =
  if (speed >= 0 && speed <= 255)

These links should help get you started
Python - Arduino demo
Serial Input Basics - simple reliable ways to receive data.