Week 3: Quotes and strings
Python code typing course. 13 wpm, 90% accuracy.
In Python, text is written inside quotation marks and called a string. A string can start and end with double quotes or with single quotes, but the closing mark must match the opening one. This week you practice both marks. A string that is never closed causes an error on that line, so accuracy is the main goal.
What you will learn
This week you learn two symbols. The double quote " is pressed by holding Shift with the opposite pinky and pressing the apostrophe key with the right pinky. The single quote ' is pressed with the apostrophe key alone, also with the right pinky.
Here are two short lines that use both marks:
print("hello")
print('python')
Notice that each string starts and ends with the same mark. Type the opening quote, then the text, then the closing quote, before you move on to the next line.
Technique tips
- Check the closing mark right after you open a string. Keep your eyes on the end of the text.
- For a double quote, press Shift with the opposite pinky first, then the apostrophe key. Release both once the mark appears.
- The single quote needs no Shift. Press it lightly with the right pinky. Pressing harder does not make it faster.
- Read the whole string as one unit before you type it, such as
"hello"insideprint(). - If a string needs double quotes inside it, wrap the whole string in single quotes, like
'He said "hi"'.
Lessons
- Lesson 1 (10 to 15 minutes): Learn. Watch the keyboard demo for both quote marks. Type
print("hello")slowly. - Lesson 2 (10 to 15 minutes): Practice. Repeat lines such as
print('python')andprint("hello"). Check that each string opens and closes with the same mark. - Lesson 3 (10 to 15 minutes): Review. Take the 2-minute test built from this week’s quote drills. Note any missed closing marks and repeat those lines next time.
This week’s goal
The goal is 13 wpm with 90% accuracy. The first star comes when you finish the lessons. The second star comes at 90% accuracy, and the third when you also reach 13 wpm. With quotes, a missed closing mark causes an error, so get the marks right before you chase speed.
Symbols this week
The colored keys are the ones you learn this week. The color shows which finger presses the key.
This week’s lessons
Do the lessons in order. Each one ends with a test, and your best result is saved.