Hello, this is a notebook. It consists of cells. Each cell is a code or markdown cell.
Double-click (or press enter) to edit a cell. Press Shift+Enter to run a cell.
# this is a code cell
# press shift+enter to run it when it is selected
16*16
# By the way, lines that start with sharp key are comments
# comments are ignored by python
# 16*16
Markdown is a way to format text easily: Choose in menu above: Cell -> Cell Type to toggle markdown or code (shortcuts: M and Y)
Double click this cell to see the code for it.
The last word of this sentence is emphasized. The last word of this sentence is booooold.
good old html code also works
Math can also be included using latex, e.g. $e^{i\pi} = -1$ $$\frac{d}{dx} x^3 = 3{x^2}$$
Here's a quick markdown tutorial: link
Press Shift+Enter to run the code
It's the best calculator
3*5
3/4
27 % 11
27 // 11
2**10
Priority
4 * 2 - 5 * 2
4 * (2 - 5) * 2
3 / 2 * 5
3 / (2 * 5)
Multiplication and addition have priority. Between * and / it's left to right.
#Weird stuff:
5*"hello."
Calling functions:
# single variable
abs(-5.1)
# multi-variable
max(3,4)
cos(0)
whatt?! it doesn't know cos?!?!!
it's because cos is in an extra module we need to import
import math
math.cos(0)
# no need to import again
math.cos(math.pi)
"This is a string"
# adding strings is string concatenation
"hel" + "lo"