Python Syntax and Data Types

Lesson 2 of 20

Every value carries a type — meet ints, floats, strings and booleans working together in one tiny program.

The big picture

Names, values and types

A Python variable is just a name pointing at a value — and the value always knows its own type.

No Declarations

Write age = 25 and you are done — no int keyword, no semicolon; Python figures the type out.

The Core Four

int for whole numbers, float for decimals, str for text in quotes, bool for True and False.

Syntax Is Minimal

Statements end at the line break, and blocks open with a colon followed by an indented body.

Comments with #

Everything after # on a line is ignored — use it to leave notes for human readers.