Jupyter example

Download exercises zip

Browse files online

Example of notebook for exercises in Jupyter files.

For python files based example and more, see Python example

What to do

  • unzip exercises in a folder, you should get something like this:


WARNING: to correctly visualize the notebook, it MUST be in an unzipped folder !

  • open Jupyter Notebook from that folder. Two things should open, first a console and then browser. The browser should show a file list: navigate the list and open the notebook jupyter-example/jupyter-example.ipynb

  • Go on reading that notebook, and follow instuctions inside.

Shortcut keys:

  • to execute Python code inside a Jupyter cell, press Control + Enter

  • to execute Python code inside a Jupyter cell AND select next cell, press Shift + Enter

  • to execute Python code inside a Jupyter cell AND a create a new cell aftwerwards, press Alt + Enter

  • If the notebooks look stuck, try to select Kernel -> Restart

# This cell needs to be executed only once, you can usually find it at the beginning of the worksheets

import jupman
x = [1,2,3]
y = x
Python Tutor visualization
y = [1,2,3]
w  = y[0]
Python Tutor visualization

Exercise 1

Implement inc function:

Show solution

def inc(x): raise Exception('TODO IMPLEMENT ME !')

Exercise 2

Implement upper function

Show solution
def upper(x):
    raise Exception('TODO IMPLEMENT ME !')

Exercise 3

Note everything after the ‘write here’ comment will be discarded. Note you can put how many spaces you want in the comment

Show solution

w = 5 # write here

Exercise 4

Shows how to completely remove the content of a solution cell (including the solution comment)

EXERCISE: write a function that prints ‘hello’

Show solution

Exercise 5

Shows the QUESTION / ANSWER feature. All content in ‘ANSWER:’ cell will be stripped

QUESTION: Describe why iPhone n + 1 is better than iPhone n

Show answer


bla bla

Relative image test, Markdown format:


Relative image test, HTML img tag:


Relative link test, Markdown format:

Back to index

Relative link test, HTML a tag:

Back to index