Got this in the review stack and though it was pretty borderline. The question asks about a basic implementation of applying an acceleration based on a key press. Here's the answer:
you need to make the acceleration happens over time (per game tick) gradually.
you need to time the acceleration in such that every N seconds, it make your character moves faster until a limit is reached.
your while statement make it happen in a single tick, it make no difference than assigning X = 1.
It does very little to answer the question, and it's not written in a manner that's very readable, but it is technically answering the question and there is some guidance there about the correct approach (though very little assistance on implementation). Would this answer pass review for you?