Caffeinated Coder
Book an appointment
Lesson 04 · Basics

Input and output

A program talks to you through the terminal: print() sends output out, input() brings what you type back in. Step through a five-line program, age.py, that asks your name and age, turns the age into a number with int(), and prints a greeting and an f-string. Then see the classic mistake: forgetting that input() always gives back a string.

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

Quiz Unlocks after the last step.