# NextPeer Python Handbook ## Core concepts - Variables refer to objects; practise numbers, strings and booleans. - Lists are ordered and mutable; tuples are ordered and immutable. - Dictionaries map keys to values; sets track distinct elements. - Conditions and loops control the flow of a program. - Functions organise reusable behaviour with explicit inputs and results. ## Build good habits Use descriptive names, small functions and readable formatting. Read tracebacks from the error message back to the relevant line. Handle exceptions you understand rather than hiding every error. ## Files and data Use a context manager when opening a file. Understand the data format and validate inputs. Do not store private credentials in your program or repository. ## Environments Use a project-specific virtual environment. Record required dependencies and document the supported Python version. Install packages from sources you trust and review what your program executes. ## Exercises 1. Build a command-line calculator with invalid-input handling. 2. Count words in a text file. 3. Store student marks and calculate averages. 4. Read a sample CSV and summarise a numeric column. 5. Create an expense tracker with save and load behaviour. ## Weekly routine Learn one concept, practise small examples, add it to a project and explain it in your own words. Keep a list of mistakes and revisit them. ## Completion checklist Test normal cases, empty inputs and invalid values. Add setup instructions, sample data and known limitations to your README.