Commit a1cafc71 authored by geobumac's avatar geobumac

Ejemplo calse

parent c5c47dd8
......@@ -114,23 +114,24 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{1, 2, 3, 4, 5, 6, 7, 8, 9}"
"{3, 6, 9}"
]
},
"execution_count": 34,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Conjunto\n",
"new_set={i for i in old_list}\n",
"old_list = [1,2,2,3,4,5,6,7,7,8,9]\n",
"new_set={i for i in old_list if i%3 == 0}\n",
"new_set"
]
},
......@@ -708,7 +709,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.3"
"version": "3.6.7"
}
},
"nbformat": 4,
......
......@@ -114,23 +114,24 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{1, 2, 3, 4, 5, 6, 7, 8, 9}"
"{3, 6, 9}"
]
},
"execution_count": 34,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Conjunto\n",
"new_set={i for i in old_list}\n",
"old_list = [1,2,2,3,4,5,6,7,7,8,9]\n",
"new_set={i for i in old_list if i%3 == 0}\n",
"new_set"
]
},
......@@ -172,22 +173,23 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[4, 4, 256, 46656, 16777216]"
"[27, 46656, 387420489]"
]
},
"execution_count": 41,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"list(map(lambda i: i**i, filter(lambda i: i%2==0, old_list)))"
"old_list = [1,2,2,3,4,5,6,7,7,8,9]\n",
"list(map(lambda i: i**i, filter(lambda i: i%3==0, old_list)))"
]
},
{
......
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