{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "My name is Max Mustermann.\n",
      "'My name is Max Mustermann\n",
      "'My name is Johnny Herbert\n",
      "'My name is Peter Pan\n",
      "6\n"
     ]
    }
   ],
   "source": [
    "def myname(): # Function without an argument\n",
    "    print('My name is Max Mustermann.')\n",
    "myname() # Only use name for call \n",
    "#Output: My name is: Max Mustermann\n",
    "\n",
    "def particularname(name = 'Max Mustermann'): # Function with an argument and Default\n",
    "    print(f\"'My name is {name}\")\n",
    "particularname() # default name: Max Mustermann\n",
    "particularname('Johnny Herbert')\n",
    "particularname('Peter Pan')\n",
    "#Output: My name is Max Mustermann.\n",
    "#My name is Johnny Herbert.\n",
    "#My name is Peter Pan.\n",
    "\n",
    "def multiply_values(x,y,z):\n",
    "    return x*y*z\n",
    "print(multiply_values(1,2,3))\n",
    "#Output: 6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.0"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import math as m\n",
    "m.sqrt(4) # Calculate square root of 4\n",
    "#Output: 2.0"
   ]
  }
 ],
 "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
}
