60 seconds

Python typing test

Real lines of Python with every quote mark, bracket, colon and underscore left in. The test above is already set to Python; start typing to begin.

What does the Python typing test look like?

Each run strings together real Python one-liners, shuffled, until there are at least 55 pieces to type. Here are three of them, exactly as they appear:

def fibonacci(n: int) -> list[int]:
    seq = [0, 1]
    while len(seq) < n:
        seq.append(seq[-1] + seq[-2])
    return seq[:n]
result = [x ** 2 for x in range(1, 21) if x % 3 != 0]
print(sum(result))
with open(path, "r", encoding="utf-8") as fh:
    data = json.load(fh)
    rows = data.get("rows", [])

Typed as tokens: def fibonacci(n: int) -> list[int]: seq and so on, one Space between each.

You type each piece, press Space and move on. A piece only counts if every character is right, so one missing quote mark makes the whole piece wrong. The clock starts on your first key, and the run ends when you finish the last piece.

Which symbols slow Python programmers down?

About one character in five in these lines is a symbol, and almost all of them sit on the right side of the keyboard. Double quotes lead the list because Python strings are everywhere, then round brackets for every call, then commas and dots. Here is how often each one turns up in the Python test, and where it lives on a US keyboard:

SymbolNameShare of symbolsKey (US layout)Finger
(Opening bracket14%Shift + 9Right ring
)Closing bracket14%Shift + 0Right little
.Full stop (dot)10%.Right ring
:Colon9%Shift + ;Right little
=Equals8%=Right little
"Double quote8%Shift + 'Right little
,Comma5%,Right middle
*Asterisk5%Shift + 8Right middle
-Hyphen (minus)5%-Right little
[Opening square bracket5%[Right little

Notice how many of those are the right little finger's job. Quotes, colons, the underscore and the equals sign all belong to it, so it does far more work in Python than in prose. Keep it relaxed and close to its home key, and reach rather than moving the whole hand.

How do I type Python faster?

  • Treat Shift plus 9 and Shift plus 0 as one motion. Hold Shift with your left little finger and roll from 9 to 0 with the right ring and little fingers. Empty brackets come up constantly.
  • Learn the underscore properly. snake_case names put it in the middle of words. It is Shift plus the hyphen key, right little finger, with Shift on the left hand.
  • Type quote pairs as a unit. " is Shift plus the apostrophe key. Most of the time you type two of them around a short word, so practise the pair, not the single key.
  • Do not stop for a mistake. Fix it and carry on. On code, accuracy is worth more than speed, so slow down until the error count drops.
  • Drill what slipped. After a run, click any key in the missed-keys list and a drill built on it starts.

How is the Python test scored?

The same as every Presspace test: net words per minute counts correctly typed characters, five to a word, and accuracy counts every key you press. You also get raw WPM, consistency, your slowest pieces and a heatmap of the keys you missed. Runs are saved in your browser, so you can watch your Python speed climb.

For more on why code speed matters less than symbol fluency, read typing for programmers.

Code typing tests in other languages

All 6 languages
Advertisements

Questions people ask

What Python code will I type?

Real one-line snippets of the kind people write every day: a list comprehension, a with block that opens a file, a pandas groupby, an argparse option, a logging call and a dictionary sorted with a lambda. They are shuffled into each run, so no two tests are the same.

What is a good Python typing speed?

Expect a score well below your prose speed. Python is about one character in five a symbol, and quote marks, brackets and underscores all need Shift. So a fluent typist often scores well below their usual number on code. Compare your Python runs with each other, not with your prose speed, and watch accuracy first.

Does the Python test include indentation?

No. Each line is split on spaces and you type the pieces with one space between them. That keeps the focus on the symbols and names your hands find hardest, rather than on whitespace you cannot see.

Does choosing Python here change my settings?

No. This page opens the code test in Python for this visit only. Your saved language for the code test stays as it was until you pick one yourself in the options above the test.

Can I practise other languages?

Yes. There are code typing tests for JavaScript, TypeScript, SQL, CSS and Shell too, each with its own page. You can also switch language from the options row above the test.

Keep going

Typing tests by length: 15 second typing test · 30 second test · 1 minute typing test · 2 minute test · 5 minute typing test · 10 minute test · custom text

In other languages: Spanish typing test · French typing test · German typing test · Portuguese typing test · Italian typing test · Test de mecanografía en español · Teste de digitação em português