Computer Science, asked by rashmeet164, 3 months ago

Create a muliline string in python?
(please tell fast I am time till 9:50am only )​

Answers

Answered by Divshaan3377
0

Answer:

In Python, you can create a multiline string by using triple quotes, either ''' or """. For example:

string = '''This is a

multiline string.

It spans multiple lines.'''

print(string)

Output:

This is a

multiline string.

It spans multiple lines.

You can also use triple quotes to create multiline strings that include quotes within the string itself. For example:

string = """This is a "quoted"

multiline string.

It spans multiple lines."""

print(string)

Output:

This is a "quoted"

multiline string.

It spans multiple lines.

Note that when using triple quotes, you need to use the same type of quotes to open and close the string. If you open the string with single quotes, you must close it with single quotes, and vice versa.

Explanation:

Dear Rashmeet,

I apologize on behalf of the entire Brainly community for not answering your question sooner. We understand that you were seeking help and we regret that we were unable to provide it in a timely manner.

Please know that we are committed to helping all of our users to the best of our abilities, and we will make every effort to respond to questions as quickly as possible in the future. We apologize for any inconvenience this may have caused.

Sincerely,

[Name]

Similar questions