Skip to content

Variables and Types

What you'll learn

  • Dynamic typing basics
  • Common built-in types
  • Type conversion patterns

Explanation

Python variables are names bound to objects. A single variable name can later refer to a different type, but clarity improves when you keep type usage predictable.

Example

Run it in the browser:

count = 3
price = 19.99
title = "Python Book"
print(type(count), type(price), type(title))

Common mistakes

  • Confusing = (assignment) with == (comparison)
  • Forgetting that input() returns text

Exercises

See Foundations Exercises.

Further reading