Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 1.1 KB

arithmetic.md

File metadata and controls

71 lines (50 loc) · 1.1 KB

Arithmetic Operations

This section provides functions for performing various arithmetic operations.

addition(a, b)

Calculates the sum of two numbers.

Parameters

  • a: The first number.
  • b: The second number.

Returns

The sum of the two numbers.

Example

result = addition(5, 3)
print(result)  # Output: 8

subtraction(a, b)

Calculates the difference between two numbers.

Parameters

  • a: The first number.
  • b: The second number.

Returns

The difference between the two numbers.

Example

result = subtraction(10, 7)
print(result)  # Output: 3

multiplication(a, b)

Calculates the product of two numbers.

Parameters

  • a: The first number.
  • b: The second number.

Returns

The product of the two numbers.

Example

result = multiplication(4, 6)
print(result)  # Output: 24

division(a, b)

Divides one number by another.

Parameters

  • a: The numerator.
  • b: The denominator.

Returns

The result of the division.

Example

result = division(10, 2)
print(result)  # Output: 5.0