12.9 C
New York
Tuesday, December 6, 2022

Python: Insert New Line into String

While coding in Python, you might want your code to print out certain elements on the next line or a new line. Or you might just want to execute a statement and want the cursor to move to the next line.

The newline characters are used in these situations. You can add a newline character between strings too.

We will focus on the newline character in Python and its use in this article.

Python: Insert New Line into String

What is “\n” in Python?

In Python, you can specify the newline character by “\n”. The “\” is called the escape character used for mentioning whitespace characters such as \t

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles