Learn Python.
For Free.
Run real Python in your browser, no installs. Across five short lessons you build one tool end to end: roll a product-line P&L into a clean summary, then call a live GenAI model through an API you control. You set the rules for what it can return, so you see what working with a governed, restricted AI actually looks like, not just chatting with a chatbot.
Build one thing, start to finish
No Hello World, no syntax drills. Across three short lessons you build a single tool: a function that rolls a product-line P&L into a profitability summary. Each lesson explains every line in plain English, then you fill in one blank and run it. By the end the pieces snap together, and in the Applied track you hand it to a live AI model that you call, and control, through an API.
Write the rule once
Every product line's gross profit is the same arithmetic: revenue minus COGS. In Excel you'd type =B2-C2 and copy it down every line, every month. In Python you write that rule one time as a function and reuse it on every line. It's the first brick of the tool you're about to build.
A function is a reusable rule with a name. You define it once with the word def, list the inputs it needs in parentheses, and return the answer. After that, you can run the rule on any numbers just by calling its name, like gross_profit(500000, 150000), instead of retyping the math.
def gross_profit(revenue, cogs): return ____print(gross_profit(500000, 150000))revenue - cogsTeach it to decide
FP&A is about flags: which lines are healthy, which need a look. In Excel that's =IF((B2-C2)/B2>=0.4,"healthy","watch"), which is fine until you nest five of them and hunt the missing parenthesis at 11pm. In Python the decision reads top to bottom like a sentence, and it becomes brick two: a verdict on every line.
An if statement lets your code make a decision. It checks a condition; if that condition is true, it runs the indented line below it, otherwise it skips down to the next instruction. Here the decision is whether a line's gross margin is 40% or better.
margin = (revenue - cogs) / revenueif margin >= 0.40: return ____ return "watch""healthy"Roll up every product line
Here's the real payoff of writing rules instead of formulas: hand the function a whole list and it runs on all of it. Your P&L is a list of product lines. One loop totals revenue and COGS, flags each line with the logic from Lesson 2, prices gross profit with the function from Lesson 1, then subtracts operating expenses to land on net profit. In Excel this is a helper column plus SUM plus COUNTIF, re-pointed every time a line moves.
A for loop walks through a list one item at a time and runs the same steps on each. Here it visits each product line, adds that line's revenue and COGS to running totals, and counts the healthy ones using your Lesson 2 rule. After the loop finishes, you reuse your Lesson 1 rule on the totals, then subtract OpEx for net profit, and bundle everything into one summary.
for p in lines: revenue += p["revenue"] if margin_flag(...) == "healthy": gp = ____ return { ... }gross_profit(revenue, cogs)Three bricks in, and you've built a working P&L summary.
The Applied track points this same tool at a programmable table and a live AI model. When you want a guided path to using this at work, our programs map it out by where you're starting from.
Now do what Excel can’t
Same P&L, two more moves: rebuild your profitability summary as a table you program instead of drag, then call a live AI model from your own code, control exactly what it can return, and put it to work on the result. This is where Python stops being “spreadsheets too” and starts doing things spreadsheets never will.
The spreadsheet you can program
Your loop from Lesson 3 works. But pandas gives you the same P&L as a table that lives in code, where a column operation runs on every line at once, defined in one line, with no range that drifts when you insert a product. Same summary, far less code.
pandas is Python's spreadsheet library. It turns your P&L into a DataFrame, a table with named columns, exactly like a sheet. The superpower: you can create a whole new column in one line, and the calculation applies to every row at once. No dragging, no range to break.
import pandas as pddf = pd.DataFrame([ ... ])df["gross_profit"] = ____df["margin"] = (df["gross_profit"] / df["revenue"]).round(2)df["gross_profit"].sum()df["revenue"] - df["cogs"]Call the model on your terms
Any chatbot can write a paragraph about your numbers. The difference here is control. You are not pasting into a chat window, you are calling the model from your own code, handing it only this structured summary, and locking down what it is allowed to return. And because it is code, the same call runs one summary now or a hundred at once.
A dictionary, written with curly braces { }, is a labeled bundle of values. Each entry is a "key": value pair, a name paired with a number or a list. This is exactly the shape you hand an AI model: clean, labeled data it can read, instead of a vague sentence. Because you send only these fields, the model can't be steered off-topic.
"revenue": 1000000,"net_profit": 210000,"products": ____print(summary)["Software", "Hardware", "Services"]You just built a tool that rolls up a P&L and calls a guardrailed AI to explain it.
That is the floor, not the ceiling. The programs take this same guardrailed-AI workflow from these snippets to real pipelines on your own data, and point you to the right starting line based on where you are now.
Find your program →