ComeçarComece de graça

Multi-line docstrings

Sometimes single-line docstrings are sufficient, but if your function is more complex or has several arguments, then it is generally a better choice to include a multi-line docstring.

You'll practice this by creating a multi-line docstring for the clean_text() function you made earlier.

Este exercício faz parte do curso

Python intermediário para desenvolvedores

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

def clean_text(text, lower=True):
    # Add a multi-line docstring
    """
    ____
    
    """
    clean_text = text.replace(' ', '_')
    if lower == False:
        return clean_text
    else:
        return clean_text.lower()
Editar e executar o código