{ "cells": [ { "cell_type": "markdown", "id": "100260b0", "metadata": {}, "source": [ "# Exercise 1\n", "\n", "In this notebook you do your first steps in Python" ] }, { "cell_type": "markdown", "id": "ef054c0b", "metadata": {}, "source": [ "## Task 1: Hello World\n", "\n", "define a function called `hello` that takes no arguments and prints `Hello World!` if it is called." ] }, { "cell_type": "code", "execution_count": null, "id": "33920df3", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "84500f6d", "metadata": {}, "source": [ "## Task 2: Strings" ] }, { "cell_type": "code", "execution_count": null, "id": "e322b6f3", "metadata": {}, "outputs": [], "source": [ "a = \"I like programming\"" ] }, { "cell_type": "markdown", "id": "ffe8f88b", "metadata": {}, "source": [ "Split the variable a into three words and assign these words to the variables a1, a2 and a3." ] }, { "cell_type": "code", "execution_count": null, "id": "c6331355", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "248a27d2", "metadata": {}, "source": [ "## Task 3: Dictionaries\n", "\n", "define a dictionaries that maps names to a level of Python knowledge. As names you can take your name and the names of a few friends. The Python knowledge should be rated on a scale from 0 to 10. " ] }, { "cell_type": "code", "execution_count": null, "id": "0da3ea54", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "0b272f21", "metadata": {}, "source": [ "Now loop over the keys and values of this dictionary and print a nicely formatted message. For example for me, the message that should be printed is:\n", "\n", "`'Janos has a python level of 8.'`" ] }, { "cell_type": "code", "execution_count": null, "id": "1b795896", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "2c01a7c6", "metadata": {}, "source": [ "## Task 4: Lists\n", "\n", "Write a loop that takes that adds the next eight Fibonacci numbers to the list [1, 1]" ] }, { "cell_type": "code", "execution_count": null, "id": "3b55f6de", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "1ee60355", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.11.0" } }, "nbformat": 4, "nbformat_minor": 5 }