The output is formatted using the 'print' statement and a newline character ('\
') to separate each key.