Skip to content

Python typing practice

Python typing practice means drilling the colon, the underscore and the round bracket, not the alphabet. Python has fewer symbols than most languages, so its difficulty is concentrated: the colon ends almost every block, underscores hold names together, and indentation must be exact because it is syntax rather than style.

Practise Python now

4 exercises, each complete and syntactically valid, chosen for the characters it drills rather than for what it computes. Untimed, and no account needed.

Drills():_"=

WPM0
Accuracy0.0%
Time0:00
Raw0
Consistency0%
def average(values):
if not values:
return 0.0
return sum(values) / len(values)

Click here to start — there is no timer

Indentation is spaces. Press Enter at the end of each line.

Why is Python harder to type than English?

Python looks easy to type because it has no braces and no semicolons, and that is exactly what catches people out. The symbol load has not gone away; it has moved. Every if, for, def, while, class and with ends in a colon, which is Shift plus the right little finger, the weakest combination on the keyboard. Names are held together with underscores, which is Shift plus the right little finger again, one row down. And because indentation is syntax, four spaces that should be eight is a real error rather than an untidy line, so the space bar is carrying meaning in a way it never does in prose.

Which keys slow you down in Python?

The characters that cost the most time in Python
KeyFingerWhy it costs time
: ColonRight little finger + ShiftEnds almost every block. The single most typed symbol in Python.
_ UnderscoreRight little finger + Shiftsnake_case names and dunder methods. Same finger as the colon, one row up.
( Round bracketsRight ring and little finger + ShiftCalls, tuples and grouping. Almost always typed as a pair.
[ Square bracketsRight little fingerIndexing, slices and list comprehensions. No Shift, which surprises people.

Finger assignments follow the standard touch typing layout. The full chart is on the finger placement page.

The mistake Python typists make most

Losing the indentation rather than the characters. People concentrate on getting the symbols right, reach the end of a block, and put the next line back at the wrong depth. In prose an inconsistent indent is invisible; in Python it changes what the code means or stops it running. Practise by typing a nested block all the way through without correcting anything, then look at whether the depths are right rather than at the speed.

How fast should you type Python?

Expect roughly 55 to 70 percent of your prose speed. Python is at the faster end of the languages here because it is the least punctuated, so someone typing 70 WPM of English often reaches 40 to 48 WPM of Python once the colon is automatic.

Measure prose first so you have something to compare against — a one minute test is enough. A code speed well below the range above usually means specific symbols rather than general slowness, and the test results name which keys they are.

Questions about typing Python

How can I practise typing Python code?

Type real snippets rather than isolated symbols, because the difficulty in code is the transition between characters rather than any one key. A colon at the end of a line is easy on its own and hard after a closing bracket. Short, complete functions with correct indentation are the right unit of practice, which is what the exercises on this page are.

Why is typing Python slower than typing English?

Because the character mix is completely different. Ordinary English is about 99 percent lowercase letters typed by strong fingers. Python is full of colons, underscores, brackets and quotes, most of which need Shift and the little finger, and none of which appear often enough in prose practice to have ever become automatic.

Should programmers learn touch typing?

Yes, and the benefit is larger than for prose. Looking down costs more in code because the symbols you are hunting for are the ones furthest from the home row, and because losing your place in a line of code loses the logic you were holding in your head, not just your position in a sentence.

Do I need to practise tabs for Python?

No. Practise spaces. The Python style guide specifies four spaces per indent level, almost every editor inserts spaces when you press Tab, and Tab itself is a navigation key in a browser. The exercises here use spaces for the same reason.

All free, and no account needed.