Vektoren erweitert

This commit is contained in:
2026-03-14 21:05:34 +01:00
parent f8d4f626cf
commit 90fa546790

View File

@@ -6,8 +6,8 @@
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2026-02-21T10:38:27.574058Z",
"start_time": "2026-02-21T10:38:27.536090Z"
"end_time": "2026-02-26T09:09:10.857495Z",
"start_time": "2026-02-26T09:09:10.808456Z"
}
},
"source": [
@@ -17,20 +17,27 @@
"def sub(v1, v2):\n",
" return (v1[0] - v2[0], v1[1] - v2[1])\n",
"\n",
"def mul(k, v):\n",
" return (k*v[0], k*v[1])\n",
"\n",
"\n",
"print(add((2, 1), (3, 4)))"
"print(add((2, 1), (3, 4)))\n",
"print(sub((20,30),(40,20)))\n",
"print(mul(3,(20, 10)))\n",
"print(mul(-1,(20, 10)))"
],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(5, 5)\n"
"(5, 5)\n",
"(-20, 10)\n",
"(60, 30)\n",
"(-20, -10)\n"
]
}
],
"execution_count": 9
"execution_count": 2
},
{
"metadata": {},