The same way as you would in every other type of education. If you know what you are doing, it is easy to see how close the student came to getting it right or if they were completely on the wrong track.
What about pseudo code that has the "right logic" but will never compile?
What if I submit python code that works as a c file, should that count?