2.06
Completed
Python Integers and Floats Python Integers and Floats

Learn how Python handles whole numbers, decimal numbers, negative values, and number-looking text.

Python Integers and Floats

Sounds useful?

Jump into the interactive version.

No setup. No account. Just Python.

Interactive Python lesson

Integers and Floats in Python

Numbers are everywhere in Python, but not all numbers are the same. This Block introduces two core numeric types: int for whole numbers and float for decimal values. You will learn how to recognize them, store them in variables, check them with type(), and avoid common beginner traps like confusing 10, 10.0, and "10".

What you will learn:

  • Recognize integers such as 5, -12, and 0
  • Recognize floats such as 5.0, -12.25, and 0.0
  • Understand why the decimal dot changes the type
  • Use type() to inspect values while learning
  • Choose sensible number types for counts, measurements, ratings, and progress values
  • Tell the difference between real numbers and strings that only look like numbers
  • Notice what happens when integers and floats appear together in simple calculations

By the end, you will be able to look at common Python values and quickly tell whether they are integers, floats, or text pretending to be a number. Small topic, big usefulness.

> Start now 53 cards · about 4 min

Ready to practice this in the browser?

> Play now