← All sections

Module 2 · Python data types, variables, operators, and basic I/O operations

Python literals

The raw values you write straight into your code — numbers, text, and true/false — and the type Python gives each one.

Begin lesson 1 →
  1. 1LiteralsData written directly into your code — and how Python types it.
  2. 2IntegersWhole numbers, positive or negative, with no fractional part.
  3. 3FloatsNumbers with a decimal point — and one famous surprise.
  4. 4StringsText, wrapped in quotes that mark where it starts and ends.
  5. 5Boolean valuesJust two of them: True and False.
  6. 6QuizA few questions to lock in Python's literal types.