Commit d32cb1bc authored by geobumac's avatar geobumac

inicio cuadrado magico

parent 60023428
......@@ -465,21 +465,23 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 45,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"15.0\n"
"15.0 9 [1, 2, 3, 4, 5, 6, 7, 8, 9]\n"
]
}
],
"source": [
"def ejercicio8(n):\n",
" conmag = (n*(n**2 + 1)) / 2\n",
" print(conmag)\n",
" numdisp = n*n\n",
" lisnums = [i for i in range(1, numdisp + 1)]\n",
" print(conmag, numdisp, lisnums)\n",
"ejercicio8(3)"
]
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment