Python Typing Test
Type real Python functions, loops and dictionaries; press Enter and the next indent is filled in for you.
Loading coding passages...
Python is the one language here where line structure is syntax. This test makes you end every line in the right place, type the block-opening colons and get the dictionary punctuation exact. When you press Enter, the next line’s indentation is filled in for you, as in a code editor, so the structure is yours and the spaces are not.
What you will actually be typing
Two excerpts from the 10 Python passages in this test, shown exactly as you type them. Press Enter at the end of each line and the next line’s indentation is filled in for you. Each passage runs to several thousand characters, more than anyone types in five minutes.
def parse_profile_line(line):
row_id, owner, status, metric, value = line.strip().split("|")
return {"id": int(row_id), "owner": owner, "status": status, "completion": int(metric), "score": float(value)}
def normalize_profile_status(value):
value = str(value or "draft").strip().lower()
return value if value in {"verified", "draft"} else "draft"
def group_profile_by_owner_1(rows):
grouped = {}
for row in rows:
grouped.setdefault(row.get("owner", "unassigned"), []).append(row)
return grouped
def build_task_report(rows):
report = {}
for row in rows:
owner = row["assignee"]
report.setdefault(owner, {"count": 0, "total": 0})
report[owner]["count"] += 1
report[owner]["total"] += row["points"]
return report
def normalize_task_status(value):
value = str(value or "blocked").strip().lower()
return value if value in {"open", "blocked"} else "blocked"Who this test is for
Developers and students who can read Python comfortably but find their typing breaks down on structure: a colon forgotten at the end of a def line, Enter pressed one character too early, or a dictionary whose braces, quotes and colons arrive in the wrong order.
It also suits data analysts and scientists who write Python in notebooks all day and want the mechanical part to stop costing attention. If you are new to Python itself, read the snippets slowly first; this is a typing test, not a tutorial.
| Durations | 1, 2, 3 or 5 minutes |
|---|---|
| Passages | 10 Python passages, 46,162 characters in all; choose one before you start |
| Difficulty | One level: every passage is real working code, not graded drills |
| What counts | Every character and line break must match the passage. Enter fills in the next line’s indentation; Tab inserts two spaces |
| Speed | Gross WPM = characters typed ÷ 5 ÷ minutes. Net WPM takes one word off per error |
| Accuracy | Overall accuracy, plus symbol accuracy: the share of brackets, quotes and operators typed correctly |
| Report card | Separate counts for symbol, bracket, quote, semicolon, whitespace and new-line mistakes |
The Python symbol profile
Across 10 passages and 46,162 characters, Python here averages 14.3 symbols per 100 characters: fewer than JavaScript or HTML, because Python uses words (and, not, in) where other languages use symbols. What it has instead is whitespace and line structure.
Names average 5.8 characters, and capitals are only 0.5% of characters, the lowest of any language here. Python typing is lower-case and underscore-joined, with the structure carried by line breaks.
| Symbol | Per 100 characters |
|---|---|
| " double quote | 3.6 |
| ( parenthesis | 2.2 |
| ) parenthesis | 2.2 |
| , comma | 1.3 |
| . dot | 1.2 |
| : colon | 1.2 |
| = equals | 0.5 |
| [ bracket | 0.4 |
The symbol runs you will type most
The two leading runs are ", (closing a string and moving to the next item) and ): (closing a call or parameter list and opening a block). Both are worth drilling as single chords.
| Run | Per 1,000 characters |
|---|---|
", | 7.7 |
): | 7.2 |
(" | 4.9 |
[" | 2.1 |
"] | 2.1 |
") | 2 |
How Python compares with the other coding tests
| Measure | HTML & CSS | Java | JavaScript | Python | SQL | TypeScript |
|---|---|---|---|---|---|---|
| Symbols per 100 characters | 17.2 | 13.7 | 16.9 | 14.3 | 6.5 | 16.1 |
| Indentation, share of characters | 2.6% | 3.3% | 3% | 8.2% | 0.1% | 1.6% |
| Capital letters, share of characters | 2% | 4.4% | 2.4% | 0.5% | 22% | 4% |
| Average name length | 5.5 chars | 6.9 chars | 6.2 chars | 5.8 chars | 6.3 chars | 6.5 chars |
| Average line length | 37 chars | 39.1 chars | 36.6 chars | 40.3 chars | 32.6 chars | 53.4 chars |
Typing Python: line ends, colons and quotes
Python’s official style guide, PEP 8, asks for four spaces per indentation level and prefers spaces to tabs, and the passages follow it: 8.2% of their characters are leading whitespace, the most of any language on the site. You do not type those spaces. Press Enter at the end of a line and the test inserts the next line’s indentation, so the skill being tested is where each line ends, not counting spaces.
The colon is the key that changes what comes next. 42.3% of the non-empty lines in this test end with one: every def, for, if and with. The habit to build is colon, then Enter, as one movement. Most new-line errors in the report card are really a colon missed or an Enter pressed one key too soon.
Quotes come next. Double quotes are the single most frequent symbol in these passages, because Python dictionaries and f-strings are full of them, and f-strings add braces inside the quotes. Type the opening and closing quote of a key as a pair before you think about the word between them.
Finally, names. PEP 8 asks for lower_case_with_underscores for functions and variables, so the underscore, a Shift and little-finger reach, turns up in more than a third of the lines in these passages. If your underscores lag, practise them on their own on the symbol typing test.
Anatomy of one line
A single return line holds a whole dictionary: every key quoted, every key followed by a colon, every value by a comma. That is why the double quote is the most frequent symbol in the Python passages.
return {"id": int(row_id), "owner": owner, "status": status, "completion": int(metric), "score": float(value)}| Characters | 114, of which 4 are indentation |
|---|---|
| Letters | 72 |
| Symbols | 27 |
| Spaces | 14 |
| Keys that need Shift | 24 |
Reading your Python report card
Watch the new-line count first. In Python it is not cosmetic: a new-line error means you pressed Enter too early or too late, usually around a colon, and in real code that changes where a block begins. Whitespace errors should be rare, because indentation is filled in for you; if they appear, you are probably typing spaces after Enter out of habit.
Then look at quote errors. Because dictionaries and f-strings are made of quoted keys, a high quote count with a low bracket count means your fingers know the structure but not the string boundaries. Bracket and semicolon errors should be close to zero; Python has no statement semicolons, and its brackets mostly come in short pairs.
Mistakes the report card will show most
- Pressing Enter before the colon at the end of a def, if or for line, which the report card counts as a new-line error.
- Typing extra spaces at the start of a line after Enter has already indented it.
- Closing a dictionary’s brace before its last quote, or the reverse.
- Typing a hyphen for an underscore in a snake_case name: both are on the same key.
The habits that apply to every kind of typing, such as accuracy before speed and short daily practice, are in how to type faster. For symbols on their own, use the symbol typing test.
A three-step practice plan
The aims below are our suggestions, not pass marks. The test itself has no pass mark; it reports your speed and accuracy and lets you judge the trend.
| Step | Run | Aim for |
|---|---|---|
| Warm up | 1 minute on the symbol typing test | Quotes, colons and underscores without hesitation |
| Build | 2-minute Python runs, a different passage each time | No new-line errors in the report card |
| Stretch | 5-minute Python runs | Symbol accuracy of 95% or more, held for the whole run |
Frequently asked questions
Do I have to type the indentation?
No. When you press Enter at the end of a line, the test fills in the next line’s indentation for you, as most code editors do. Line breaks still count: Enter has to come exactly where the passage ends a line, and any extra spaces you type after it count as whitespace errors. 8.2% of the characters in the Python passages are indentation, all of it handled for you.
What does the Tab key do?
Tab inserts two spaces. You will rarely need it, because Enter fills in indentation automatically; pressing Tab where the passage has no spaces counts as an error.
Why do I make more mistakes on Python than on prose?
Because the hard keys are not letters. Colons, quotes, brackets and underscores are reaches off the home row, often with Shift, and they come in clusters such as ("id"): in a single dictionary entry. Accuracy usually recovers once those clusters become single movements.
How long is each test, and is the passage the same every time?
You can choose 1, 2, 3 or 5 minutes. There are 10 Python passages, and you can switch between them before you start, so a longer run does not mean typing the same code twice.
Does the test use tabs anywhere?
No. All indentation in the Python passages is spaces, four per level, and it is filled in for you when you press Enter.
Are the f-strings and comprehensions real Python?
Yes. The passages are valid-looking Python built around everyday tasks such as parsing, grouping and reporting, including f-strings, dictionary methods and list comprehensions.
I type Python fine in my editor. Why is the test harder?
The test indents for you, like an editor, but it does not close brackets or quotes as you open them, and it does not autocomplete names. Everything except indentation comes from your fingers, which is useful practice for interviews, shared screens and any editor you have not set up.
Other coding typing tests
Sources
Conventions cited on this page come from the sources below. Every figure about the passages is measured from the passages themselves, and recalculated each time the site is built.
- PEP 8 — Style Guide for Python CodePython Software Foundation · link checked 20 Oct 2026