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.
Questo esercizio fa parte del corso
Intermediate Python for Developers
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
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()