Not really. The example is showing a command-line interaction so showing command and results together seems reasonable. Think of it like you're giving someone a view of your console, this is both natural and common in examples.

If you just wanted to show results, then thats different - but you probably wouldn't show the command with the # at the start indicating a shell prompt :-).