Question Detail
Question
Which of the following characters are counted by the
len() function when determining the length of a string?
Correct Answer
Option C is the correct answer.
Detailed Explanation
The document explicitly states, 'Crucial: It counts spaces and punctuation marks too!' The
len() function counts every character that makes up the string, including letters, numbers, spaces, punctuation, and any other special characters.
Hint
The
len() function considers a string as a sequence of *all* characters.