Professor of Computer Science @ Olin College

# Solutions Extension Demo

Last updated: December 24th, 2018

#### Exercise 1¶

Write a function add that receives two numbers and returns the sum of them:

In [ ]:
def add(x, y):
# your code here
pass

In [ ]:
# Tests:
assert add(2, 3) == 5
assert add(4, 3) == 7

In [1]:
def add(x, y):
return x + y


Markdown cells can also be solutions, for example:

#### Exercise 2¶

Use LaTeX math notation, to write out the formula of "sum of squares":

$$\sum_{i=1}^n i^2$$