Sleeping can assist with general decision making, and yes removing yourself from food options will obviously help you with a calorie deficit.

However neither of these show the GPs point of "exercise is one way to lose weight".