PEP 8 is the usual Python style. You do not need a linter in this tab. You do need names, spacing, and short functions a teammate can read.
Goal
Rewrite a messy kiosk snippet into snake_case helpers and a CONSTANT.
Before
def Tot(u,p):
return round(u*p*1.16,2)
print(Tot(2,10))That works. It does not read.
After
TAX = 0.16
def line_total(units, price):
return round(units * price * (1 + TAX), 2)
print(line_total(2, 10))TAXis a constant (all caps).line_totalissnake_case.- Spaces around
*. - A blank line before the top-level
printin a real file (here the script is short).
Names
cities = ["Nairobi", "Mombasa", "Kisumu"]
n_cities = len(cities)
is_coast = "Mombasa" in cities
print(n_cities, is_coast)n_cities counts. is_coast is a boolean. Avoid data, temp, x unless the scope is three lines.
Pitfall
This editor does not run black or ruff. Paste tidy code anyway — reviews start with names, not pixels.