How to use 'indent python code online' in Python

Every line of 'indent python code online' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
215def _indent_block(self, code):
216 lines = code.splitlines()
217 pad = ' '*4
218 return '\n'.join(pad + x for x in lines)
691def _format_code(code):
692 lines = code.splitlines()
693 format = "%%%dd %%s\n" % len(repr(len(lines) + 1))
694 return "".join([format % (i + 1, line) for (i, line) in enumerate(lines)])

Related snippets