Skip to content
Typing Summit

Python typing practice

Type real Python: f-strings, list and dictionary comprehensions, classes, dataclasses and error handling. Python is lighter on braces but heavy on colons, underscores and brackets.

5 snippets · key symbols: : _ [ ] ( ) f"{ }" ==

Count words in a file · Python
Press Enter at the end of each line. Indentation is filled in for you.
from collections import Counter↵↵def top_words(path, n=10):↵ with open(path) as f:↵ words = f.read().lower().split()↵ return Counter(words).most_common(n)
Guide

How to type Python faster

Python has its own set of symbols and patterns. Typing them in real code, with Enter and auto-indent like your editor, builds speed where it matters.

  1. 01

    Colons and indentation

    Every def, if, for and class line ends with a colon, and the next line is indented. Press Enter and the indentation is filled in, so you can focus on the colon habit.
  2. 02

    Underscores and brackets

    Names like __init__ and snake_case variables use the underscore constantly, and comprehensions stack square and round brackets. Both are common weak keys.
  3. 03

    f-strings

    f-strings mix quotes and curly braces in one expression. They are the fastest way to format output, once your fingers know them.

Questions people ask

2 answers

How can I type Python faster?

+

Touch type first, then practise the symbols Python uses most: colon, underscore, brackets and quotes. Real snippets like these train them in context.

Do I need to type the indentation?

+

No. Press Enter at the end of each line and the indentation of the next line is filled in for you.