Question: Our new CTO wants us to format all of our code using PEP8 standards. This includes Python code with lines no longer than 80 up to a maximum of 100 characters. I have this extended line of code. Any tips on how I can break this line into a 2-3 clean, readable lines. 

```
    # Identify if Authenticated 
    identify = ''
    if is_authenticated:
        fullname = request.user.full_name if 'full_name' in request.user else ''
        identify = 'mixpanel.identify("{} ");\nmixpanel.people.set({{"$email": {email}, "$name": {name}}})'.format(email=request.user.email, name=fullname)

```

I have already tried string breaking such as:

```
    # Identify if Authenticated 
    identify = ''
    if is_authenticated:
        fullname = request.user.full_name if 'full_name' in request.user else ''
        identify = 'mixpanel.identify("{} ");\n'
        'mixpanel.people.set({{"$email": {email}, "$name": {name}}})'.format(email=request.user.email, name=fullname)

```

... but linting gave back an error (red squiggly) of an unrecognized format, when I referenced another SO post saying this is okay. 

I also considered putting everything starting with `.format`.

Any tips?

Answer: 
I would take advantage of parenthesis:

```
    identify = ''
    if is_authenticated:
        fullname = request.user.full_name if 'full_name' in request.user else ''
        form = (
            'mixpanel.identify("{} ");\n'
            'mixpanel.people.set({{"$email": {email}, "$name": {name}}})'
        )
        identify = form.format(email=request.user.email, name=fullname)

```
I'd end up with a triple quote passed to textwrap.dedent and the call format on the result. `textwrap.dedent("""\` as many lines as needed `""").format(...)`. The line continuation in the opening of the triple is to suppress the blank first line. I also like using that in documentation strings.