Skip to content

Commit 2c94b9d

Browse files
committed
Updated Intro to Python for fall2024
1 parent b4fbc46 commit 2c94b9d

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

01_intro_to_python.ipynb

+18-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@
9898
"There is considerable online documentation and tutorials for python.\n",
9999
"\n",
100100
"### Other intros: \n",
101-
" - [Basic Python](https://docs.python.org/3/tutorial/introduction.html)\n",
101+
" - [Python's Introduction](https://docs.python.org/3/tutorial/introduction.html)\n",
102+
" - [Yet Another Tutorial](https://www.tutorialspoint.com/python/index.htm)\n",
102103
" - [Software Carpentry - Programming in Python](http://swcarpentry.github.io/python-novice-inflammation/)\n",
103104
" - [Columbia Foundations for Research Computing Bootcamps](https://rcfoundations.research.columbia.edu/)"
104105
]
@@ -168,6 +169,17 @@
168169
"4.0 + 4.0**(3.0 / 2.0)"
169170
]
170171
},
172+
{
173+
"cell_type": "markdown",
174+
"metadata": {
175+
"slideshow": {
176+
"slide_type": "-"
177+
}
178+
},
179+
"source": [
180+
"Note: See full list of operators supported in python [here](https://www.tutorialspoint.com/python/python_basic_operators.htm)"
181+
]
182+
},
171183
{
172184
"cell_type": "markdown",
173185
"metadata": {
@@ -895,7 +907,7 @@
895907
"### `if`\n",
896908
"This is the basic logical control. A set of instructions is executed if a given condition is met. Note that Python decides what set of commands to execute based on how the code is indented. The '{' and '}' characters have a very different meaning in Python than in C, C++, or Java.\n",
897909
"\n",
898-
"Note: See full list of operators supported in python [here](https://www.tutorialspoint.com/python/python_basic_operators.htm)"
910+
"Note: See full list of control flow supported in python [here](https://www.tutorialspoint.com/python/python_control_flow.htm)"
899911
]
900912
},
901913
{
@@ -1374,9 +1386,12 @@
13741386
"def fibonacci(n):\n",
13751387
" \"\"\"Return a list of the Fibonacci sequence up to n\"\"\"\n",
13761388
" values = [0, 1]\n",
1377-
" while values[-1] <= n:\n",
1389+
" while values[-1] < n:\n",
13781390
" values.append(values[-1] + values[-2])\n",
13791391
" print(values)\n",
1392+
" else: \n",
1393+
" if values[-1] != n:\n",
1394+
" del values[-1]\n",
13801395
" return values\n",
13811396
"\n",
13821397
"fibonacci(100)"

0 commit comments

Comments
 (0)