You can quiet literally write the question as it is.
The difference of a number x and 2 is 7.
The difference of a number x and 2 can be written as x-2
is can be written as equal or =
This statement can be translated as x-2=7.
It is as simple as that!