Lesson 6 Quiz: Strings: Text, Quotes, and Length

Self-check only. Your answers stay in your browser — nothing is submitted or graded. Pick an answer for each question, then press Check my answers to see the answer key and explanations.

1. What is a string?

2. Why might you choose single quotes instead of double quotes?

3. What does `"Hello" + " " + "Sam"` produce, and why is the `" "` needed?

4. What is `len("hello world")`, and does the space count?

5. In the string `"Sam"`, what is position 0, and what happens if you ask for position 3?

← Back to Lesson 6 · Enroll free in the full course