Question Detail

COS 102 Python strings Objective Question

Question

What is a Python string primarily defined as?
Options
A A collection of numbers
B A sequence of characters wrapped in quotes
Correct Answer
C A list of Boolean values
D A single character
Correct Answer

Option B is the correct answer.

Detailed Explanation

According to the document (page 3), 'In Python, a string is simply a sequence of characters wrapped in quotes.'

Hint

Think about how strings store textual data and their syntax in Python.

Question Info