Mathematics with Python and Ruby/Numbers

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.


Last modified on 20 March 2012, at 21:50