Tarea 2 con la tarea 1 hasta abajo

parent b8ed191b
......@@ -308,14 +308,14 @@
},
{
"cell_type": "code",
"execution_count": 74,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[True, False, True, False, True, False, True, False, True, False]\n"
"['Par', 'Non', 'Par', 'Non', 'Par', 'Non', 'Par', 'Non', 'Par', 'Non']\n"
]
}
],
......@@ -326,7 +326,7 @@
"par'''\n",
"\n",
"def parLogico(l1):\n",
" par=[True if num%2==0 else False for num in l1]\n",
" par=[\"Par\" if num%2==0 else \"Non\" for num in l1]\n",
" return par\n",
"\n",
"pars=parLogico(a)\n",
......@@ -538,14 +538,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[(4, 3, 5)]\n"
"[(4, 3, 5), (5, 12, 13), (6, 8, 10)]\n"
]
},
{
......@@ -554,7 +554,7 @@
"True"
]
},
"execution_count": 1,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
......@@ -572,7 +572,7 @@
" yield i, valores - 1, valores + 1\n",
"\n",
"\n",
"print (list(tripletaPita(4)))\n",
"print (list(tripletaPita(6)))\n",
"\n",
"#a,b,c\n",
"#4,-7,9\n",
......
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