Computer Science, asked by btsarmyrockers, 10 months ago

What are the different ways to declare multiline String?

Answers

Answered by Anonymous
3

Answer:

Create a Python Multiline String with Examples

  1. Use triple quotes to create a multiline string. It is the simplest method to let a long string split into different lines. ...
  2. Use brackets to define a multiline string. ...
  3. Backslash to join string on multiple lines. ...
  4. Join() method to create a string with newl

Explanation:

A multiline string in Python begins and ends with either three single quotes or three double quotes. Any quotes, tabs, or newlines in between the “triple quotes” are considered part of the string. Python's indentation rules for blocks do not apply to lines inside a multiline string.

You can use three apostrophes or three quotation marks to create a multi-line string.

Similar questions