{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of the variable is greater than 19!\n"
     ]
    }
   ],
   "source": [
    "#Example of an if statement\n",
    "value = 20\n",
    "\n",
    "if value < 19:\n",
    "    print('The value of the variable is less than 19!')\n",
    "elif value == 19:\n",
    "    print('The value of the variable is equal 19!')\n",
    "else:\n",
    "    print('The value of the variable is greater than 19!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Value: 0\n",
      "Value: 2\n",
      "Value: 4\n",
      "Value: 0\n",
      "Value: 2\n",
      "Value: 4\n",
      "Content: String1, Data type: <class 'str'>\n",
      "Content: 5, Data type: <class 'int'>\n",
      "Content: 5.5, Data type: <class 'float'>\n",
      "Content: String2, Data type: <class 'str'>\n"
     ]
    }
   ],
   "source": [
    "#Example of a for-loop\n",
    "values = [0,2,4] # Serie/Sequence of objects\n",
    "for x in values:\n",
    "    print(f\"Value: {x}\") \n",
    "\n",
    "values_range = range(0,6,2) # range(startvalue,endvalue,interval) \n",
    "for x in values_range:\n",
    "    print(f\"Value: {x}\") \n",
    "\n",
    "objects = [\"String1\", 5, 5.5, \"String2\"] # different types possible\n",
    "for typ in objects:\n",
    "    print(f\"Content: {typ}, Data type: {type(typ)}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The calculated sum is 120\n"
     ]
    }
   ],
   "source": [
    "#Example of a while-loop\n",
    "i = 1\n",
    "sum = 0\n",
    "noiterations = 15\n",
    "while i <= noiterations:\n",
    "    sum = sum + i\n",
    "    i = i + 1\n",
    "print(\"The calculated sum is\", sum)"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "b832d7f6f4293094ba6af71bf82f35c75f0b83983feb898075166bc33d6317e0"
  },
  "kernelspec": {
   "display_name": "lab-env",
   "language": "python",
   "name": "lab-env"
  },
  "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.10.2"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
