August 29, 2026
Why doctors should learn Python, and how AI changes the on-ramp
I finished medical school in 2023 and I have been writing software for longer than that. For most of that time, telling a colleague “you should learn to code” felt like telling them to learn a second specialty. The advice was correct and useless: between the wards and the exams, nobody has six spare months to fight with semicolons before their first useful script.
That calculus has changed, and I do not think most clinicians have noticed how much.
The on-ramp used to be the problem
Programming was never conceptually hard for physicians. We memorize dosing tables, we reason through differential diagnoses, we follow protocols with nested conditions. That is control flow. The barrier was always mechanical: environment setup, cryptic error messages, and the long gap between “hello world” and anything that touches your actual work.
A doctor who wants to analyze a spreadsheet of lab values does not care about virtual environments. They care about the question in the spreadsheet. Traditionally, the distance between those two points swallowed people.
What AI actually changes
AI coding tools do not remove the need to understand code. They remove the need to produce it from a blank page. That is a different and much better trade than it sounds:
- You describe the analysis in the language you already think in, and read the code it produces.
- Reading code is a far gentler skill to build than writing it, the same way reading an ECG comes before interpreting one under pressure.
- Errors become conversations instead of dead ends.
The skill that matters now is judgment: knowing what to ask for, recognizing when the output is wrong, and understanding enough Python to check the logic against your clinical knowledge. That skill is learnable in weeks, not months, and it compounds.
Why Python specifically
Python is where health data analysis lives: pandas for the data itself, the statistical stack for the tests reviewers expect, and every bioinformatics pipeline you will ever touch has Python somewhere in it. It is also the language AI tools write best, which matters when the AI is your pair programmer.
The honest caveat
AI-generated code fails in quiet ways, and in healthcare quiet failures are the expensive kind. A model will happily run the wrong statistical test with full confidence. This is exactly why clinicians should learn the fundamentals rather than skip them: not to type every line themselves, but to be the person in the room who catches the wrong test before it reaches a manuscript, or a patient.
That combination, clinical judgment plus enough Python to verify what the machine wrote, is the actual skill of the next decade in medicine. The on-ramp has never been shorter.
I teach exactly this in my six week course, Python Coding with AI in Healthcare.