{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Lesson A1 – Hello, World!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Hello, World!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
We will start this tutorial writing a \"Hello, World!\" program, i.e a program that outputs \"Hello, World!\" on the monitor.
\n", "\n", "In Python, we can do this with the following line. We open a Jupyter notebook session and execute this statement in a code cell:
" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Hello, World!\n" ] } ], "source": [ "print(\"Hello, World!\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Although this is fairly simple, it includes already a lot of the\n", "elements, we need to understand to learn programming in Python.\n", "First of all, let's consider the expression `\"Hello, World!\"` in double\n", "quotes itself. By putting a sequence of alpha-numerical characters in\n", "quotes, Python recognises this as a *string* object. We will learn\n", "more on strings later. Second, we have used the `print` directive. This is\n", "considered a *function* object. Functions are used to do specific things.\n", "While we will look at functions in Python\n", "in more detail later, note only so much now: A function can be *called*,\n", "that is told to execute its purpose, by using parentheses: `print()`. This\n", "function takes a string, `\"Hello, World!\"`, as an *argument*. As a\n", "consequence of our function call, the string passed to the function, is\n", "displayed on the screen." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "