I just typed this out for a pinky exercise. You guys try it and time yourself / count the typos:
import os; import sys; import re
x = {"a":1, "b":2, "c":3}
y = [i for i in range(10) if i%2==0]
z = (lambda a,b: a*b + (a/b if b!=0 else 0))
def f(a:int, b:int)->int: return a+b
def g(x): return {"ok":True, "val":x}
print("start:", x, y, z(3,4))
s = "[]{}();:'\"\\|/<>?!.,"
t = 'single "double" mix'
u = f(10, 20); v = g(u)
assert u == 30
assert "a" in x
for k,v in x.items():
print(k, "->", v)
for i in range(3):
for j in range(2):
print(i, j, i*j)
lst = [x**2 for x in range(5)]
dct = {i:i*i for i in range(5)}
setv = {i%3 for i in range(10)}
a,b,c = 1,2,3
a,b = b, a
path = r"C\Users\name\test\file.txt"
expr = (a+b)*(c-d)/(a if b else 1)
flag = True and False or not False
check = (1<2) and (2<=3) and (3!=4)
logic = (a==b) or (b==c) and (a!=c)
text = "line1\nline\tindented"
escape = "quotes

" backslash

\ pipe

\ slash:/"
json_like = {"x":[1,2,3], "y":{"z":0}}
nested = [[[1,2], [3,4]],[5,6],[7,8]]
matrix = [[i*j for j in range(3)] for i in range(3)]
funcs = [lambda x:x+1, lambda x:x*2, lambda x: x**2]
result = [f(2,3), g(10), z(5,6)]
try:
risky = 10/0
except ZeroDivisionError as e:
print("error:", e)
with open("a.txt", "w") as f:
f.write("data\nmore data\n")
regex = re.compile(r"[a-zA-Z0-9_]+@[a-z]+\.[a-z]+")
match = regex.search("
test@example.com")
print(match.group() if match else None)
data = {"ops":"[]{}();:'\"\\|/<>?"}
seq = list(range(10))[1:8:2]
rev = seq[::-1]
comp = {x:y for x,y in zip(range(3), range(3,6))}
truth = all([True, True, False])
anyv = any([False, False, True])
fmt = f"value={a+b*c-d/e}"
debug = f"{x=}, {y=}, {z=}"
pipe = "a|b|c|d".split("|")
chain = (1+2-3)*4/5
angle = (a<b) ? a : b if False else c
print("end:", s, t, u, v)