<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_headers(self, span_context):
 """Convert a SpanContext object to W3C Distributed Tracing headers, using version 0. :type span_context: :class:`~opencensus.trace.span_context.SpanContext` :param span_context: SpanContext object. :rtype: dict :returns: W3C Distributed Tracing headers. """

        trace_id = span_context.trace_id
        span_id = span_context.span_id
        trace_options = span_context.trace_options.enabled

        # Convert the trace options
        trace_options = '01' if trace_options else '00'

        headers = {
            _TRACEPARENT_HEADER_NAME: '00-{}-{}-{}'.format(
                trace_id,
                span_id,
                trace_options
            ),
        }
        tracestate = span_context.tracestate
        if tracestate:
            headers[_TRACESTATE_HEADER_NAME] = \
                TracestateStringFormatter().to_string(tracestate)
        return headers