NextPeer Logo

NextPeer

All Resources

Python Handbook

Core concepts, small exercises and a simple practice routine.

Download editable TXT

Core concepts

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.