Wednesday, December 29, 2010

Python has six basic operations for numbers

Python has six basic operations for numbers:

Operation Symbol Example
Exponentiation ** 5 ** 2 == 25
Multiplication * 2 * 3 == 6
Division / 14 / 3 == 4
Remainder % 14 % 3 == 2
Addition + 1 + 2 == 3
Subtraction - 4 - 3 == 1

No comments:

Post a Comment