Commit a1cafc71 authored by geobumac's avatar geobumac

Ejemplo calse

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