Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync pull #1

Merged
merged 18 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 32 additions & 17 deletions .ipynb_checkpoints/Numbers-checkpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#Numbers and more in Python!\n",
"# Numbers and more in Python!\n",
"\n",
"In this lecture, we will learn about numbers in Python and how to use them.\n",
"\n",
Expand All @@ -30,21 +30,35 @@
"\n",
"Throughout this course we will be mainly working with integers or simple float number types.\n",
"\n",
"Here is a table of the two main types we will spend most of our time working with some examples:\n",
"\n",
"<table border = “1“>\n",
"<caption>Numbers in Python</caption> \n",
"Here is a table of the two main types we will spend most of our time working with some examples:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<table>\n",
"<tr>\n",
" <th>Examples</th> <th>Number \"Type\"</th>\n",
" <th>Examples</th> \n",
" <th>Number \"Type\"</th>\n",
"</tr>\n",
"<td>1,2,-5,1000</td> <td>Integers</td> \n",
"\n",
"<tr>\n",
" <td>1,2,-5,1000</td>\n",
" <td>Integers</td> \n",
"</tr>\n",
"<td>1.2,-0.5,2e2,3E2</td> <td>Floating-point numbers</td> \n",
"\n",
"<tr>\n",
" <td>1.2,-0.5,2e2,3E2</td> \n",
" <td>Floating-point numbers</td> \n",
"</tr>\n",
" </table>\n",
" \n",
" </table>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" \n",
" \n",
"Now let's start with some basic arithmetic."
Expand Down Expand Up @@ -155,7 +169,7 @@
"source": [
"### <font color='red'>Python 3 Alert!</font>\n",
"\n",
"**Woah! What just happened? Last time I checked, 3 divided by 2 is equal 1.5 not 1!**\n",
"**Whoa! What just happened? Last time I checked, 3 divided by 2 is equal 1.5 not 1!**\n",
"\n",
"The reason we get this result is because we are using Python 2. In Python 2, the / symbol performs what is known as \"*classic*\" division, this means that the decimal points are truncated (cut off). In Python 3 however, a single / performs \"*true*\" division. So you would get 1.5 if you had inputed 3/2 in Python 3.\n",
"\n",
Expand Down Expand Up @@ -280,7 +294,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"When you import division from the __future__ you won't need to worry about classic division occuring anymore anywhere in your code!"
"When you import division from the __future__ you won't need to worry about classic division occurring anymore anywhere in your code!"
]
},
{
Expand Down Expand Up @@ -606,22 +620,23 @@
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python [conda root]",
"language": "python",
"name": "python2"
"name": "conda-root-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.10"
"pygments_lexer": "ipython3",
"version": "3.5.3"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"collapsed": true
},
"source": [
"## Test your knowledege. \n",
"## Test your knowledge. \n",
"\n",
"** Answer the following questions **"
]
Expand Down Expand Up @@ -111,7 +111,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Answer: Because Python 2 performs classic division for integers. Use floats to perform true divsion. For example:\n",
"**Answer: Because Python 2 performs classic division for integers. Use floats to perform true division. For example:\n",
"2.0/3**"
]
},
Expand Down Expand Up @@ -270,7 +270,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Given the string 'hello' give an index commadn that returns 'e'. Use the code below:"
"Given the string 'hello' give an index command that returns 'e'. Use the code below:"
]
},
{
Expand Down Expand Up @@ -506,29 +506,29 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"l = [3,4,5,5,6]"
"l = [5,3,4,6,1]"
]
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[3, 4, 5, 5, 6]"
"[1, 3, 4, 5, 6]"
]
},
"execution_count": 38,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -540,18 +540,18 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[3, 4, 5, 5, 6]"
"[1, 3, 4, 5, 6]"
]
},
"execution_count": 40,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -688,7 +688,7 @@
"outputs": [],
"source": [
"# This will be hard and annoying!\n",
"d = {'k1':[1,2,{'k2':['this is tricky',{'toughie':[1,2,['hello']]}]}]}"
"d = {'k1':[1,2,{'k2':['this is tricky',{'tough':[1,2,['hello']]}]}]}"
]
},
{
Expand All @@ -711,7 +711,7 @@
],
"source": [
"# Phew\n",
"d['k1'][2]['k2'][1]['toughie'][2][0]"
"d['k1'][2]['k2'][1]['tough'][2][0]"
]
},
{
Expand Down Expand Up @@ -739,7 +739,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"What is the major difference betwen tuples and lists?"
"What is the major difference between tuples and lists?"
]
},
{
Expand Down Expand Up @@ -1047,8 +1047,9 @@
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python [default]",
"language": "python",
"name": "python3"
},
Expand All @@ -1062,7 +1063,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
"version": "3.5.3"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"collapsed": true
},
"source": [
"## Test your knowledege. \n",
"## Test your knowledge. \n",
"\n",
"** Answer the following questions **"
]
Expand Down Expand Up @@ -141,7 +141,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Given the string 'hello' give an index commadn that returns 'e'. Use the code below:"
"Given the string 'hello' give an index command that returns 'e'. Use the code below:"
]
},
{
Expand Down Expand Up @@ -213,7 +213,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Build this list [0,0,0] two seperate ways."
"Build this list [0,0,0] two separate ways."
]
},
{
Expand Down Expand Up @@ -258,7 +258,7 @@
},
"outputs": [],
"source": [
"l = [3,4,5,5,6]"
"l = [5,3,4,6,1]"
]
},
{
Expand Down Expand Up @@ -322,7 +322,7 @@
"outputs": [],
"source": [
"# This will be hard and annoying!\n",
"d = {'k1':[1,2,{'k2':['this is tricky',{'toughie':[1,2,['hello']]}]}]}"
"d = {'k1':[1,2,{'k2':['this is tricky',{'tough':[1,2,['hello']]}]}]}"
]
},
{
Expand All @@ -348,7 +348,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"What is the major difference betwen tuples and lists?"
"What is the major difference between tuples and lists?"
]
},
{
Expand Down Expand Up @@ -558,8 +558,9 @@
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python [default]",
"language": "python",
"name": "python3"
},
Expand All @@ -573,7 +574,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
"version": "3.5.3"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion Decorators Homework.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"#Decorators Homework (Optional)\n",
"\n",
"Since you won't run into decorators until further in your coding career, this homework is optional. Check out the Web Framework [Flask](http://flask.pocoo.org/). You can use Flask to create web pages with Python (as long as you know some HTML and CSS) and they use decorators a lot! Learn how they use [view decorators](http://flask.pocoo.org/docs/0.10/patterns/viewdecorators/). Don't worry if you don't completely understand everything about Flask, the main point of this optional homework is that you have an awareness of decorators in Web Frameworks, that way if you decide to become a \"Full-Stack\" Python Web Developer, you won't find yourself perplexed by decorators. You can also check out [Django](https://www.djangoproject.com/) another (and more popular) web framework for Python which is a bit more heavy duty.\n",
"Since you won't run into decorators until further in your coding career, this homework is optional. Check out the Web Framework [Flask](http://flask.pocoo.org/). You can use Flask to create web pages with Python (as long as you know some HTML and CSS) and they use decorators a lot! Learn how they use [view decorators](http://flask.pocoo.org/docs/0.12/patterns/viewdecorators/). Don't worry if you don't completely understand everything about Flask, the main point of this optional homework is that you have an awareness of decorators in Web Frameworks, that way if you decide to become a \"Full-Stack\" Python Web Developer, you won't find yourself perplexed by decorators. You can also check out [Django](https://www.djangoproject.com/) another (and more popular) web framework for Python which is a bit more heavy duty.\n",
"\n",
"Also for some additional info:\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions Dictionaries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
"source": [
"## Nesting with Dictionaries\n",
"\n",
"Hopefully your starting to see how powerful Python is with its flexibility of nesting objects and calling methods on them. Let's see a dictionary nested inside a dictionary:"
"Hopefully you're starting to see how powerful Python is with its flexibility of nesting objects and calling methods on them. Let's see a dictionary nested inside a dictionary:"
]
},
{
Expand All @@ -332,7 +332,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Wow! Thats a quite the inception of dictionaries! Let's see how we can grab that value:"
"Wow! That's a quite the inception of dictionaries! Let's see how we can grab that value:"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions GUI/3 - Widget Events.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
"outputs": [],
"source": [
"# Create Caption\n",
"caption = widgets.Latex(value = 'The values of slider1 and slider2 are synchronized')\n",
"caption = widgets.Label(value = 'The values of slider1 and slider2 are synchronized')\n",
"\n",
"# Create IntSlider\n",
"slider1 = widgets.IntSlider(description='Slider 1')\n",
Expand All @@ -326,7 +326,7 @@
"outputs": [],
"source": [
"# Create Caption\n",
"caption = widgets.Latex(value = 'Changes in source values are reflected in target1')\n",
"caption = widgets.Label(value = 'Changes in source values are reflected in target1')\n",
"\n",
"# Create Sliders\n",
"source = widgets.IntSlider(description='Source')\n",
Expand Down Expand Up @@ -380,7 +380,7 @@
"outputs": [],
"source": [
"# NO LAG VERSION\n",
"caption = widgets.Latex(value = 'The values of range1 and range2 are synchronized')\n",
"caption = widgets.Label(value = 'The values of range1 and range2 are synchronized')\n",
"\n",
"range1 = widgets.IntSlider(description='Range 1')\n",
"range2 = widgets.IntSlider(description='Range 2')\n",
Expand All @@ -398,7 +398,7 @@
"outputs": [],
"source": [
"# NO LAG VERSION\n",
"caption = widgets.Latex(value = 'Changes in source_range values are reflected in target_range1')\n",
"caption = widgets.Label(value = 'Changes in source_range values are reflected in target_range1')\n",
"\n",
"source_range = widgets.IntSlider(description='Source range')\n",
"target_range1 = widgets.IntSlider(description='Target range ')\n",
Expand Down
2 changes: 1 addition & 1 deletion Iterators and Generators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"\n",
"We've touch on this topic in the past when discussing the range() function in Python 2 and the similar xrange(), with the difference being the xrange() was a generator.\n",
"\n",
"Lets explore a little deep. We've learned how to create functions with **def** and the **return** statement. Generator functions allow us to write a function that can send back a value and then later resume to pick up where it left off. This type of function is a generator in Python, allowing us to generate a sequence of values over time. The main difference in syntax will be the use of a **yield** statement.\n",
"Lets explore a little deeper. We've learned how to create functions with **def** and the **return** statement. Generator functions allow us to write a function that can send back a value and then later resume to pick up where it left off. This type of function is a generator in Python, allowing us to generate a sequence of values over time. The main difference in syntax will be the use of a **yield** statement.\n",
"\n",
"In most aspects, a generator function will appear very similar to a normal function. The main difference is when a generator function is compiled they become an object that support an iteration protocol. That means when they are called in your code the don't actually return a value and then exit, the generator functions will automatically suspend and resume their execution and state around the last point of value generation. The main advantage here is that instead of having to compute an entire series of values upfront and the generator functions can be suspended, this feature is known as *state suspension*.\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion Jupyter (iPython) Notebooks Guide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"# Guide to Using Jupyter Notebooks\n",
"In this lecture we will be going over the basics of the Jupyter (previously called iPython Notebooks).\n",
"\n",
"For a complete User Manual check out the [Bryn Mawr College Computer Science Guide](http://jupyter.cs.brynmawr.edu/hub/dblank/public/Jupyter%20Notebook%20Users%20Manual.ipynb).\n",
"For a complete User Manual check out the [Bryn Mawr College Computer Science Guide](https://athena.brynmawr.edu/jupyter/hub/dblank/public/Jupyter%20Notebook%20Users%20Manual.ipynb).\n",
"\n",
"Most of the breakdown will actually occur in the presentation corresponding to this Notebook. So please refer to either the presentation or the full User Manual linked above."
]
Expand Down
4 changes: 4 additions & 0 deletions Milestone Project 1 - Advanced Solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@
" print(\"Sorry, please input a number between 1-9.\")\n",
" continue\n",
"\n",
" if choice not in range(1,10):\n",
" print(\"Sorry, please input a number between 1-9.\")\n",
" continue\n",
"\n",
" if board[choice] == \" \":\n",
" board[choice] = mark\n",
" break\n",
Expand Down
Loading