Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
title author date
Arithmetic Essentials
Damian Mingle
05/05/2018

Assign values to variables

a = 11
b = 7

a plus b

a + b
18

a minus b

a - b
4

a times b

a * b
77

The remainder of a divided by b

a % b
4

a divided by b

a / b
1.5714285714285714

a divided by b (the quotient)

a // b
1

a raised to the b power

a ** b
19487171

a plus b, then divide by a

(a + b) / a
1.6363636363636365

Comparing: Division Methods

Classic divison of 4 by 7

4 / 7
0.5714285714285714

Floor divison of 4 by 7

# This is a simple truncation of any remainder
4 // 7
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.