- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a long multi-line string in Python?
To create multiline strings, instead of using one pair of single/double quotes, we use three pairs. For example,
multiline_str = """ My multi-line string """ print multiline_str
This will give the output:
My multi-line string
Note that you cannot interpolate strings using this notation. This notation is also used to define docstrings in Python.
- Multi-Line printing in Python
- Multi-Line Statements in Python
- How to Create a Multi-line Text Input (Text Area) In HTML?
- How to put multi-line comments inside a Python dict()?
- How to execute Python multi-line statements in the one-line at command-line?
- How do I split a multi-line string into multiple lines?
- How do we write Multi-Line Statements in Python?
- How to comment each condition in a multi-line if statement in Python?
- How to write long strings in Multi-lines C/C++?
- How to write multi-line comment in Java?
- How to write multi-line comments in C#?
- How to Create a Long-Term Financial Plan?
- Java multi-line comments
- How to style multi-line conditions in 'if' statements in Python?
- How to plot a multi-colored line, like a rainbow using Matplotlib?