Commit efa8d9df authored by Gaspar's avatar Gaspar

Cambios iniciales

parent 205c898a
......@@ -774,10 +774,41 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n",
"3\n",
"4\n",
"5\n",
"6\n",
"7\n",
"8\n",
"9\n",
"10\n",
"11\n",
"12\n",
"13\n",
"14\n",
"15\n",
"16\n",
"17\n",
"18\n",
"19\n",
"20\n"
]
}
],
"source": [
"for i in range(21):\n",
" print(i)"
]
},
{
"cell_type": "markdown",
......@@ -788,12 +819,27 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"13\n",
"21\n",
"34\n",
"55\n",
"89\n"
]
}
],
"source": [
"A = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]\n",
"\n"
"i=0\n",
"for i in A:\n",
" if i > 10:\n",
" print(i)"
]
},
{
......@@ -805,12 +851,21 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 14,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{1, 2, 3, 5, 8, 13}\n"
]
}
],
"source": [
"a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]\n",
"b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]\n"
"b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]\n",
"print(set(a) & set(b))"
]
},
{
......@@ -839,11 +894,24 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 17,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20\n"
]
}
],
"source": [
"a = [8, 2, 3, 0, 7]"
"a = [8, 2, 3, 0, 7]\n",
"\n",
"def sumList(lista):\n",
" print(sum(lista))\n",
" \n",
"sumList(a)"
]
},
{
......@@ -855,11 +923,20 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 21,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1, 2, 3, 4, 5]\n"
]
}
],
"source": [
"a = [1,2,2,3,3,3,3,4,5,5]"
"a = [1,2,2,3,3,3,3,4,5,5]\n",
"print(list(set(a)))"
]
},
{
......@@ -970,7 +1047,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.3"
"version": "3.5.2"
}
},
"nbformat": 4,
......
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