H13-311_V3.5 · Question #175
What quotation marks can the Python language use? (Multiple Choice)
The correct answer is A. Single quotes B. Double quotes C. Three quotes. Python supports three forms of string delimiters: single quotes ('), double quotes ("), and triple quotes (''' or """), making A, B, and C all correct. Single and double quotes define standard single-line strings and are interchangeable, which is useful when your string content…
Question
What quotation marks can the Python language use? (Multiple Choice)
Options
- ASingle quotes
- BDouble quotes
- CThree quotes
- DFour quotes
How the community answered
(35 responses)- A71% (25)
- D29% (10)
Explanation
Python supports three forms of string delimiters: single quotes ('), double quotes ("), and triple quotes (''' or """), making A, B, and C all correct. Single and double quotes define standard single-line strings and are interchangeable, which is useful when your string content contains one type of quote. Triple quotes (three consecutive single or double quotes) define multi-line strings and are commonly used for docstrings.
Option D (four quotes) is simply not a valid Python string delimiter - Python would parse """" as a closing triple-quote followed by an extra ", likely causing a syntax error depending on context.
Memory tip: Think "1, 1, 3" - Python has two single-character delimiters (' and ") and one triple-character delimiter ('''/"""). There is no "four-quote" form in any mainstream language.
Topics
Community Discussion
No community discussion yet for this question.