Monday, June 7, 2021

5- Arithmetic Operators

Python can operate with numbers using the usual mathematical operators, and some special operators, too.

πŸ‘‡πŸ‘‡πŸ‘‡Click Read more

  • a + b = Adds a and b

  • a - b = Subtracts b from a

  • a * b = Multiplies a and b

  • a / b = Divides a by b

  • a ** b = Elevates a to the power of b. For non-integer values of b, this becomes a root (i.e. a**(1/2) is the square root of a)

  • a // b = The integer part of the integer division of a by b

  • a % b = The remainder part of the integer division of a by b


No comments:

Post a Comment

Your comment will taken into consideration.