Jump to content

Mathematics with Python and Ruby/Numbers

From Wikibooks, open books for an open world

The Python language is weakly typed, which means that it determines the type of a variable at the moment of first allocation (its instantiation). Python possesses five categories of numbers:

  1. int for whole numbers;
  2. long for large whole numbers;
  3. fraction for fractions (divisions of whole numbers);
  4. decimal and float for real numbers (in reality, decimal numbers);
  5. complex for complex numbers.