functions

Beginner-friendly tutorials on defining and calling functions in Python.

LLM Tool Calling: Build a Raw Agent Loop From Scratch

LLM tool calling is what turns a chatbot into something that does real work: the model reads a request, decides it needs one of your functions, and hands that decision back as JSON for your code to run. Frameworks like LangGraph and CrewAI wrap this in nice classes, but underneath they all run one small loop. Here we build that loop by hand, about sixty lines of plain Python. “An agent is a model calling tools in a loop. Everything ... Read More

Python Interview Questions: The 40 That Actually Get Asked

Most Python interview questions in a phone screen come from the same list of roughly forty fundamentals, reworded slightly from company to company. This post is that list: five groups covering the data model, functions, OOP, concurrency, and tooling, each with a spoken answer, code tested on Python 3.14.6, and a link to its deep-dive lesson. Score yourself at the end and build a revisit list from your misses. “Programs must be written for people to read, and only incidentally ... Read More

SQL GROUP BY, CTEs, and Window Functions, Explained

Your boss never asks for the grand total. They ask which product is number one in each category, and how this month compares to last. Answering that without losing the row-level detail is exactly what SQL window functions are for. This post builds up from GROUP BY and CTEs to ROW_NUMBER, RANK, LAG, and running totals, all on the SQLite that ships with Python. “Programming isn’t about what you know; it’s about what you can figure out.” Chris Pine, Learn ... Read More