Skip to main content

Two types of numbers

Python has two ways to store numbers: Integers - Whole numbers without decimals
Floats - Numbers with decimal points
Python uses a dot (.) for decimals, not a comma. Writing 3,14 creates a tuple, not the number 3.14!

Why two types?

Python separates integers and floats for efficiency - computers can work with whole numbers faster and more precisely. But here’s the reassuring part: in practice, you rarely need to think about this. Python handles the conversion automatically when needed, and most of the time you’ll just use whatever makes sense - whole numbers for counting things, decimals for measurements and calculations.

Basic math operations

Numbers work just like a calculator:

Integer vs float division

Division has two forms:
These are just the basics! Python can solve complex math problems too. When you need square roots, trigonometry, or advanced calculations, ask AI to help with the specific syntax - no need to memorize every math symbol right now.

Common mistakes

What’s next?

Now let’s learn about working with text in Python!

Strings

Text and characters