2.05
Completed
Checking Types with type() Checking Types with type()

Learn how to inspect Python values with type(), spot common beginner types, and understand why tiny quotes can change everything.

Checking Types with type()

Sounds useful?

Jump into the interactive version.

No setup. No account. Just Python.

Interactive Python lesson

Checking Types with type()

Python values come in different kinds: whole numbers, decimal numbers, text, booleans, and even None. This Block shows you how to inspect those values with type(), read outputs like <class 'int'>, and understand what Python is really working with.

You will see how similar-looking values can behave very differently. 25, 25.0, and "25" may look related, but Python sees them as separate types. Tiny quotes, big consequences.

What you will learn:

  • Use type() to check the type of a value
  • Recognize beginner-friendly types: int, float, str, bool, and NoneType
  • Check the current type of a variable
  • Understand how reassignment can change what type a variable holds
  • Spot the difference between values like True and "True"
  • Use print(type(...)) as a simple debugging tool when a value acts suspicious

By the end, you will have a small but very useful Python flashlight: when something behaves strangely, you can check what type it actually is before blaming the keyboard.

> Start now 103 cards · about 8 min

Ready to practice this in the browser?

> Play now