How can I handle spaces and indentations on a text file (file handling)?
Solution 1:
There's a builtin Python library called textwrap
that can do this for you:
import textwrap
content = """\
fizz buzz
foo bar
"""
print(textwrap.dedent(content))
Output:
fizz buzz
foo bar