Week 2: Parentheses and calls

Python code typing course. 12 wpm, 90% accuracy.

In Python you call a function by writing its name followed by parentheses. print() and type() both work this way. The skill this week is keeping every opening parenthesis paired with a closing one. A missing closing parenthesis stops the whole line from running, so accuracy matters more than speed.

What you will learn

This week you learn two symbols: the opening parenthesis ( and the closing parenthesis ). On the US English layout, press ( by holding Shift with the opposite pinky and pressing 9 with the right ring finger. Press ) by holding Shift with the opposite pinky and pressing 0 with the right pinky.

Here are two short calls to practice with:

print(7)
type(7)

In each line, type print( first, then the value, then the closing ) at the end. Once that order feels natural, the parentheses will start to appear in the right place without much thought.

Technique tips

  • Press Shift with the opposite pinky first, then touch the bracket key. Release both together after the symbol appears.
  • As soon as you type an opening parenthesis, think about the closing one. Keep your eyes on the end of the line to check it.
  • The 9 and 0 keys sit on the number row, above the home row. Keep your wrists floating so the reach stays short.
  • Read the whole call before you type it. Treat print(7) as one unit, not as a set of separate characters.
  • Return your fingers to the home row after each symbol. This habit keeps long lines from falling apart.

Lessons

  1. Lesson 1 (10 to 15 minutes): Learn. Watch the keyboard demo for ( and ). Then type print(7) slowly, one piece at a time.
  2. Lesson 2 (10 to 15 minutes): Practice. Repeat short calls such as print(1), type(1) and print(2). Check every line for a matching closing parenthesis.
  3. Lesson 3 (10 to 15 minutes): Review. Take the 2-minute test built from this week’s bracket drills. Note the symbols you missed and repeat them the next time you practice.

This week’s goal

The goal is 12 wpm with 90% accuracy. You earn the first star by finishing the lessons. The second star comes at 90% accuracy, and the third when you also reach 12 wpm. With parentheses, accuracy comes first. One missing bracket is enough to break a line.

Symbols this week

The colored keys are the ones you learn this week. The color shows which finger presses the key.

` ~ 1 ! 2 @ 3 # 4 $ 5 % 6 ^ 7 & 8 * 9 ( 0 ) - _ = + Backspace Tab Q W E R T Y U I O P [ { ] } \ | Caps A S D F G H J K L ; : ' " Enter Shift Z X C V B N M , < . > / ? Shift Ctrl Win Alt Alt Gr Win Menu Ctrl

This week’s lessons

Do the lessons in order. Each one ends with a test, and your best result is saved.

  1. Lesson 1: Learn

    New symbols: ( )

    12 minutes

    Start
  2. Lesson 2: Practice

    Practice

    12 minutes

    Start
  3. Lesson 3: Review and test

    Review and test

    12 minutes

    Start

All weeks