The following is part of a on-going collection of Jupyter notebooks. The goal being to have a library of notebooks as an introduction to Mathematics and technology. These were all created by Gavin Waters. If you use these notebooks, be nice and throw up a credit somewhere on your page.

Basic Math functions

First, we want to start out by saying that numbers are not always stored as "real" numbers. If you dont specify that a whole number is a real( floating point ) then python assumes that is is an integer

There is the usual motely of operators

Please notice that $2^3$ is expressly written as "**" not "^"

So what is "^"

011 = 3 in binary that becomes $0*2^2 + 1*2^1 +1*2^0$
100 = 4 in binary that becomes $1*2^2 + 0*2^1 +0*2^0$


111 = 7 in binary that becomes $1*2^2 + 1*2^1 +1*2^0$

011 = 3 in binary that becomes $0*2^2 + 1*2^1 +1*2^0$
010 = 2 in binary that becomes $0*2^2 + 1*2^1 +0*2^0$


001 = 1 in binary that becomes $1*2^2 + 1*2^1 +1*2^0$

The quotient function

The quotient function is built into python using the "//" command

Then come the inequalities

Also we can check whether or not two numbers are different from each other. This is done by boolean logic, we make a statement and then python outputs "True" or "False"

These inequalities can also work for strings. In the sense that the letters have a natrual order and we can treat them as numbers in a 26-base system.

This is a great way to check if two strings are equal.

Next would be the "%" operator

Can you guess what the operator "%" does from the following examples?

Hint, its the remainder function

quick step functions

You can use python shorthand to do quick operations on variables. For example, if you have a variable and want to just add a number to that variable. you would use....

Remember that this alters your variable, so use cautiously. Also, this is an operation, so you cannot print this.

Lets have a look at some of these quick steps

You can use alot of these functions with strings too!!