Caffeinated Coder
Book an appointment
Lesson 02 · Basics

Numbers and strings

Every value in Python has a type. Use the >>> prompt as a calculator and meet the three ways to divide, then step through a five-line program, tea.py, that makes an int, a float and a string, prints them, and turns a number into text with str(). Finish with what happens when you mix text and a number without converting: a TypeError.

12 min9 steps5 questionsBeginner
Fig 2 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.