PracticeForExam
This commit is contained in:
@ -24,15 +24,30 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 20,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[[6, 5, 3, 4, 6, 5, 8, 3, 6, 5]]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"lines = []\n",
|
||||
"with open(\"matrix.txt\") as file:\n",
|
||||
" lines.append([list(map(int,i.strip().split())) for i in file.readlines()])\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"print([list(map(sum,i)) for i in lines])"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
@ -46,7 +61,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.3"
|
||||
"version": "3.12.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
Reference in New Issue
Block a user