Skip to content
Hi, Bot

Hi, Bot · First Principles · Phase 1: Logic, functions, symbols

Lesson 7 of 48

Python: syntax and types

Your first real language, and the discipline of saying what kind of thing you mean.

A type is a promise about what a value can do. Most beginner bugs are a string where a number was meant. Naming types out loud is the cheapest debugging habit you will ever build.

Do this

Write a terminal program that asks for input, branches on it, and does something useful. Then hand it to someone told to break it — it must not crash.

The question that unlocks the next lesson

In Python, `input()` returns the text “12”. What does `input() + 1` do?

  • AReturns 13
  • BReturns “121”
  • CRaises a TypeError — you cannot add an int to a str
  • DSilently converts and returns 13.0

Start at lesson 1 and work up to this one

48 lessons, one a day. Answer each lesson's question correctly and the next one opens immediately — nothing here is unlocked by waiting.

By submitting, you agree to our Terms and Privacy Policy.