Name variables for the shape they hold
Choose Python variable names that communicate data shape and reduce review mistakes.
The move: Name the data shape A name like rows, row, totals_by_region, or active_users tells the reader what operations should be legal. Shape-aware names prevent mistakes like treating a string as a list or a list as a dictionary. PEP 8 frames style as a tool for readability, not decoration. The official tutorial teaches the same bias through examples: write the thing you mean, choose the built-in shape that matches the data, and keep the control flow visible. When a script moves from personal scratchpad to shared work, the cost of cleverness rises. Names, indentation, data shape, and explicit error…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in