Floats in Python

< Datatypes in Python

Introduction
Integers are used for whole numbers. Floats are used for numbers that aren't integers. Some examples are 0.5 and -7.8237591.

Example
The following code...

Will give the following results...

Extra info

 * Computers can't store floats perfectly accurately, in the same weay that we can't write down the complete decimal expansion of 1/3 (0.33333333333333...). Keep this in mind, because it often leads to infuriating (Dutch: irritante) bugs.
 * Dividing any two integers produces a float. A float is also produced by running an operation on two floats, or on a float and an integer.
 * A float can be added to an integer, because Python silently converts the integer to a float.