{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "54307518-5d76-49aa-82d7-25afd9751e6a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T12:25:28.943477Z",
     "iopub.status.busy": "2026-04-29T12:25:28.941947Z",
     "iopub.status.idle": "2026-04-29T12:25:28.951648Z",
     "shell.execute_reply": "2026-04-29T12:25:28.950596Z",
     "shell.execute_reply.started": "2026-04-29T12:25:28.943402Z"
    }
   },
   "outputs": [],
   "source": [
    "def f(x,y):\n",
    "    \"\"\"Eine einfache Test-Funktion\"\"\"\n",
    "    if x > 2 and y < x:\n",
    "        return 2*x\n",
    "    else:\n",
    "        return 3*y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "b6851de2-f100-4aa9-95a1-dece679a4b3e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T12:25:37.276870Z",
     "iopub.status.busy": "2026-04-29T12:25:37.275920Z",
     "iopub.status.idle": "2026-04-29T12:25:37.292023Z",
     "shell.execute_reply": "2026-04-29T12:25:37.290528Z",
     "shell.execute_reply.started": "2026-04-29T12:25:37.276756Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function f in module __main__:\n",
      "\n",
      "f(x, y)\n",
      "    Eine einfache Test-Funktion\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "dc218acf-5689-4f5c-8329-6d928e7d5331",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T12:28:07.823546Z",
     "iopub.status.busy": "2026-04-29T12:28:07.822601Z",
     "iopub.status.idle": "2026-04-29T12:28:07.830240Z",
     "shell.execute_reply": "2026-04-29T12:28:07.829054Z",
     "shell.execute_reply.started": "2026-04-29T12:28:07.823430Z"
    }
   },
   "outputs": [],
   "source": [
    "import math"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "fd0e9169-083b-4e75-b35b-82a19b458bb1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T12:28:13.246305Z",
     "iopub.status.busy": "2026-04-29T12:28:13.245427Z",
     "iopub.status.idle": "2026-04-29T12:28:13.253868Z",
     "shell.execute_reply": "2026-04-29T12:28:13.252422Z",
     "shell.execute_reply.started": "2026-04-29T12:28:13.246231Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function cos in module math:\n",
      "\n",
      "cos(x, /)\n",
      "    Return the cosine of x (measured in radians).\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(math.cos)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "dc4d57ba-e91b-452e-89a9-97acc120b14a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T12:30:54.279717Z",
     "iopub.status.busy": "2026-04-29T12:30:54.278204Z",
     "iopub.status.idle": "2026-04-29T12:30:54.287299Z",
     "shell.execute_reply": "2026-04-29T12:30:54.285774Z",
     "shell.execute_reply.started": "2026-04-29T12:30:54.279592Z"
    }
   },
   "outputs": [],
   "source": [
    "def bogenmass(grad):\n",
    "    return (math.pi/180) * grad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "e5497b29-0dba-4d87-8699-0f3652a5f1f2",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T12:31:17.798855Z",
     "iopub.status.busy": "2026-04-29T12:31:17.797448Z",
     "iopub.status.idle": "2026-04-29T12:32:27.118721Z",
     "shell.execute_reply": "2026-04-29T12:32:27.116537Z",
     "shell.execute_reply.started": "2026-04-29T12:31:17.798768Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7071067811865476"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "math.cos(bogenmass(45))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1ded9633-ca91-4476-ac38-15a22488ab65",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "4956dad2-d749-4468-8ff8-702e503b49fc",
   "metadata": {},
   "source": [
    "# Wochenaufgabe"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e70bce3b-d934-459e-8bba-e180734d0b12",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T19:20:58.375992Z",
     "iopub.status.busy": "2026-04-29T19:20:58.374445Z",
     "iopub.status.idle": "2026-04-29T19:20:58.395645Z",
     "shell.execute_reply": "2026-04-29T19:20:58.393078Z",
     "shell.execute_reply.started": "2026-04-29T19:20:58.375818Z"
    }
   },
   "source": [
    "### Aufgabe 2.1 - eigene Funktion `zinssatz`\n",
    "\n",
    "Schreiben Sie eine Funktion `zinssatz(kapital)`, die als Parameter ein Startkapital\n",
    "übergeben bekommt und dann als Ergebnis den Zinssatz gemäß der obigen Staffelung zurückliefert."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "3b2c3af3-f33c-4700-b9d6-e4e9b004393e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T19:22:05.059472Z",
     "iopub.status.busy": "2026-04-29T19:22:05.058593Z",
     "iopub.status.idle": "2026-04-29T19:22:05.066641Z",
     "shell.execute_reply": "2026-04-29T19:22:05.065035Z",
     "shell.execute_reply.started": "2026-04-29T19:22:05.059354Z"
    }
   },
   "outputs": [],
   "source": [
    "def zinssatz(kapital):\n",
    "    if kapital <= 5000:\n",
    "        return 0.04\n",
    "    elif kapital <= 10000:\n",
    "        return 0.0475\n",
    "    else:\n",
    "        return 0.0525"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "11cffcde-f76c-413b-b08c-19d1f4a57a64",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T19:22:05.428979Z",
     "iopub.status.busy": "2026-04-29T19:22:05.428189Z",
     "iopub.status.idle": "2026-04-29T19:22:05.435134Z",
     "shell.execute_reply": "2026-04-29T19:22:05.433852Z",
     "shell.execute_reply.started": "2026-04-29T19:22:05.428868Z"
    }
   },
   "outputs": [],
   "source": [
    "def zinssatz2(kapital):\n",
    "    if kapital <= 5000:\n",
    "        return 0.04\n",
    "    if kapital <= 7500:\n",
    "        return 0.0425\n",
    "    if kapital <= 10000:\n",
    "        return 0.0475\n",
    "    return 0.0525"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "edae1300-11b7-451e-8487-db7b6d4330b2",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T19:22:05.799848Z",
     "iopub.status.busy": "2026-04-29T19:22:05.798966Z",
     "iopub.status.idle": "2026-04-29T19:22:05.806089Z",
     "shell.execute_reply": "2026-04-29T19:22:05.804878Z",
     "shell.execute_reply.started": "2026-04-29T19:22:05.799722Z"
    }
   },
   "outputs": [],
   "source": [
    "def zinssatz3(kapital):\n",
    "    if kapital <= 5000:\n",
    "        return 0.04\n",
    "    else:\n",
    "        if kapital <= 10000:\n",
    "            return 0.0475\n",
    "        else:\n",
    "            return 0.525"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "36a3f63c-41fd-4bf8-968b-8fa581058970",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-04-29T19:22:07.856687Z",
     "iopub.status.busy": "2026-04-29T19:22:07.855904Z",
     "iopub.status.idle": "2026-04-29T19:22:07.867862Z",
     "shell.execute_reply": "2026-04-29T19:22:07.866313Z",
     "shell.execute_reply.started": "2026-04-29T19:22:07.856576Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.0425"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "zinssatz2(6500)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f35e1f90-7917-4756-9722-7123c2cffa27",
   "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.12.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
