Skip to content

M1: Your first Python program

You've used software your whole life. Today you cross to the other side of the screen and write some, a real program, running in your browser, that talks back to you by name. No installing, no setup, nothing to break. By the end you'll have written code on day one.

Today's win: you write and run your own Python program, a personalized tip helper that asks questions and answers you, and you can read every single line.

Today you will

  • Run Python in your browser (Google Colab), nothing to install
  • Use the four ideas every program is built from: print, variables, types (text / number / true-false), and input
  • Build a small program from your own life and post it to the wins board

Run of show (~50 min)

Time What we do
0:00 Hook + the win we're chasing
0:05 The one idea: a program is instructions that turn input → output (full read in notes.md)
0:10 Lab: open lab/lab.md and write code (breakout pairs)
0:40 Show: post your program's output to the chat wins board
0:45 Wrap + take-home

If you get stuck

  • That's normal, beginners hit a red error message in their first ten minutes. It's safe, and it's how this works. Nothing here can harm your computer.
  • Re-read the You should now see line under the step you're on. Compare screens with your breakout partner.
  • A red error usually means one tiny typo (a missing " or )). Read the last line of the error, it names the problem. Still stuck? Post in chat.

Optional challenge

Make the program ask for the tip percentage too (instead of fixing it at 18), and split the total between a number of people. One more input(), one more line of maths. Bring your output to the chat.