In [1]:
2 + 2
Out[1]:
In [2]:
3 - 8
Out[2]:
In [3]:
6 * 9
Out[3]:
In [4]:
8 / 2
Out[4]:
In [5]:
5 % 2
Out[5]:
In [6]:
width = 60
In [7]:
height = 90
In [8]:
width * height
Out[8]:
In [9]:
'Hello,world'
Out[9]:
In [10]:
"Monty Python's Flying Circus"
Out[10]:
In [11]:
['Hello', 3]
Out[11]:
In [12]:
def add(a, b):
return a + b
In [13]:
add(1, 3)
Out[13]:
In [14]:
def calc_tax(price, tax_rate=0.08):
return price + price * tax_rate
In [15]:
calc_tax(100)
Out[15]:
In [16]:
calc_tax(100, 0.1)
Out[16]:
In [17]:
calc_tax(price=100, tax_rate=0.1)
Out[17]:
In [18]:
calc_tax(tax_rate=0.1, price=100)
Out[18]:
In [19]:
range(10)
Out[19]:
In [20]:
list(range(10))
Out[20]: