Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Tutorial 2 Preparation\n",
"This notebooks helps you prepare for the first test during tutorial 2. The purpose of the test is to ensure that everyone has access to the software needed for the course and knows the basics on how to operate it. Step through this preparation one by one and you have no problem passing!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Open an empty Jupyter Notebook\n",
"Precisely how to do what will depend on how you installed Jupyter on your computer. Typically you need to start the notebook server on your computer, then navigate a browser to a local URL such as http://localhost:8888."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2. Change the name of the notebook\n",
"To change the name, click on the `Untitled` name on the very top of the page. Name your notebook `FirstnameLastname_test1.ipynb`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3. Execute a simple python command\n",
"In the new notebook, you will see one cell. In this cell you can enter any python code. As an example, why don't we add two numbers with this code: `1+1`. To execute the code, press `SHIFT`+`ENTER` at the same time. You should see the result of your calculation below the command you entered. You will also see a new empty cell appearing just below. Play around with a few simple calculations, always pressing `SHIFT`+`ENTER` to execute them."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4. Create a markdown cell\n",
"By default the cells in your notebook expect code. But you can also define a cell to be a so called markdown cell. In a markdown cell you can enter text or equations to document your code. Create a markdown cell in your notebook and enter some text with parts of it in bold, italic, underlined, and large font. Also add the following equation: \n",
"$$\\pi=3.1415 \\ldots$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 5. Import a package\n",
"We'll use two packages in this course: numpy and matplotlib. To make sure everything works, try importing both of them with the following commands:\n",
"\n",
"` import numpy `\n",
"\n",
"` import matplotlib`\n",
"\n",
"If the import statements work, you've most likely installed all the required packages correctly. Try printing out the value of $\\pi$ which is built into numpy."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.