1. Home
  2. Data Science
  3. Python
  4. How do you write a multi-line string in Python?

Added 25 Nov 2026

How do you write a multi-line string in Python?

  1. Using backslashes only
  2. Using double hash
  3. Using triple quotes Correct answer
  4. Using <<EOF

Correct answer

C. Using triple quotes

6 views

MCQSEXAM

Explanation

Triple single or double quotes allow strings that span multiple lines.

Reference

Asked in: Python Interview Basics

https://docs.python.org/3/tutorial/introduction.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs