Skip to content

Commit 77636e2

Browse files
author
Stiven Ramírez Arango
committed
Efficient Python Programming
1 parent a95bf1d commit 77636e2

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pipfile

Pipfile

-11
This file was deleted.

efficient_loops.ipynb

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
{
1111
"cell_type": "code",
12-
"execution_count": 5,
12+
"execution_count": 7,
1313
"source": [
1414
"import numpy as np\n",
1515
"import matplotlib.pyplot as pp"
@@ -19,7 +19,7 @@
1919
},
2020
{
2121
"cell_type": "code",
22-
"execution_count": 11,
22+
"execution_count": 8,
2323
"source": [
2424
"import geopy\n",
2525
"import cartopy"
@@ -29,7 +29,7 @@
2929
},
3030
{
3131
"cell_type": "code",
32-
"execution_count": 12,
32+
"execution_count": 9,
3333
"source": [
3434
"for n in [1, 1, 2, 3, 5, 7, 13, 21, 34, 55]:\n",
3535
" print(n)"
@@ -56,7 +56,7 @@
5656
},
5757
{
5858
"cell_type": "code",
59-
"execution_count": 14,
59+
"execution_count": 10,
6060
"source": [
6161
"for l in 'Fibonnaci':\n",
6262
" print(l)"
@@ -82,7 +82,7 @@
8282
},
8383
{
8484
"cell_type": "code",
85-
"execution_count": 15,
85+
"execution_count": 11,
8686
"source": [
8787
"it = iter('Fib')\n",
8888
"print(it.__next__())\n",
@@ -107,7 +107,7 @@
107107
"traceback": [
108108
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
109109
"\u001b[0;31mStopIteration\u001b[0m Traceback (most recent call last)",
110-
"\u001b[0;32m/tmp/ipykernel_16983/1088781718.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__next__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__next__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__next__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
110+
"\u001b[0;32m/tmp/ipykernel_9934/1088781718.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__next__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__next__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__next__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
111111
"\u001b[0;31mStopIteration\u001b[0m: "
112112
]
113113
}
@@ -116,7 +116,7 @@
116116
},
117117
{
118118
"cell_type": "code",
119-
"execution_count": 20,
119+
"execution_count": 12,
120120
"source": [
121121
"for game in open('games.txt', 'r'):\n",
122122
" print(game, end='')"
@@ -151,10 +151,10 @@
151151
},
152152
"kernelspec": {
153153
"name": "python3",
154-
"display_name": "Python 3.8.10 64-bit ('odoo-import-XIKXzSe5': venv)"
154+
"display_name": "Python 3.8.10 64-bit ('efficient-programming-PFgt-KC3': venv)"
155155
},
156156
"interpreter": {
157-
"hash": "6cc2b2069d36fc482887d803359d3a77a78ea5e51c0cc7ef3da195c0d2f84b51"
157+
"hash": "09d6e683a61e3bc609628a38fd0ca5e80f1aa7f7fec892f110b4dece76435a47"
158158
}
159159
},
160160
"nbformat": 4,

0 commit comments

Comments
 (0)