Skip to content
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
6 changes: 3 additions & 3 deletions Day_1/00_Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This unit provides a basic introduction to Python. By the end of the week, you s

1. Run Python from both the Shell and in an IPython Notebook
2. Write basic commands using Python syntax
3. Grasp the major Python object types, including integers, floats, strings, lists, sets, and dictionaries
3. Grasp the major Python [object](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#object) [types](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#type), including [integers](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#integer), [floats](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#floating-point-number), [strings](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#string), lists, sets, and dictionaries
4. Operate and manipulate those objects
5. Integrate choices into your programs using conditionals
5. Integrate choices into your programs using [conditionals](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#conditional-statement)


# What is Programming
Expand Down Expand Up @@ -43,7 +43,7 @@ Thus "knowing how to program" means learning how to *think* like a programmer, n

![xkcd](http://sslimgs.xkcd.com/comics/wisdom_of_the_ancients.png)

Here's the sad reality: When you're programming, 80% or more of your time will be spent debugging, looking stuff up (like program-specific syntax, documentation for packages, useful functions, etc.), or testing. This does not just apply to beginner or intermediate programmers, although you will grow more "fluent" over time.
Here's the sad reality: When you're programming, 80% or more of your time will be spent debugging, looking stuff up (like program-specific syntax, [documentation](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#documentation) for packages, useful functions, etc.), or testing. This does not just apply to beginner or intermediate programmers, although you will grow more "fluent" over time.

If you're a good programmer, you're a good detective!

Expand Down
106 changes: 36 additions & 70 deletions Day_1/02_Jupyter Notebooks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"source": [
"## Navigating in Jupyter Notebook\n",
"\n",
"Jupyter Notebooks have more useful features for interactive use than the standard python interpreter, but they work in the same basic way: you type things and then execute them.\n",
"Jupyter Notebooks have more useful features for interactive use than the standard python interpreter, but they work in the same basic way: you [type](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#type) things and then execute them.\n",
"\n",
"Unlike many graphical systems, there is no button to run your code! Instead, **you run code using Shift-Enter**. This also moves you to the next box (or \"cell\") for code below the one you just ran (but this may change in the future).\n",
"\n",
Expand All @@ -48,19 +48,11 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Look Ma, I'm programming!\n"
]
}
],
"outputs": [],
"source": [
"print(\"Look Ma, I'm programming!\")"
]
Expand All @@ -71,24 +63,16 @@
"source": [
"If you hit **Enter** only, IPython Notebook gives you another line in the current cell.\n",
"\n",
"This allows you to compose multi-line commands and submit them to python all at once."
"This allows you to [compose](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#compose) multi-line commands and submit them to python all at once."
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3\n"
]
}
],
"outputs": [],
"source": [
"a = 1 + 2\n",
"print(a)"
Expand All @@ -105,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"collapsed": true
},
Expand All @@ -123,19 +107,11 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n"
]
}
],
"outputs": [],
"source": [
"i = i + 1\n",
"print(i)"
Expand All @@ -157,7 +133,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"collapsed": true
},
Expand Down Expand Up @@ -254,20 +230,11 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "EOL while scanning string literal (<ipython-input-6-61291db6b185>, line 1)",
"output_type": "error",
"traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-6-61291db6b185>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m print(\"Or am I)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m EOL while scanning string literal\n"
]
}
],
"outputs": [],
"source": [
"print(\"Or am I)"
]
Expand All @@ -292,19 +259,11 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"And three shall be the count.\n"
]
}
],
"outputs": [],
"source": [
"mystring = \"And three shall be the count.\" \n",
"\n",
Expand All @@ -320,23 +279,11 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'mystring' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-caa579c4cd49>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmystring\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'mystring' is not defined"
]
}
],
"outputs": [],
"source": [
"print(mystring)"
]
Expand All @@ -356,7 +303,26 @@
"\n",
"When you close your Jupyter notebook window, all of your values will be lost. But you can save your code for a later time.\n",
"\n",
"To end the Jupyter server, go back to your shell and type `CTRL+C`"
"First go to File --> Close and Halt in order to shutdown the notebook you are using. Once all notebooks are shutdown, to end the Jupyter server, go back to your shell and type `CTRL+C`."
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Challenge 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- Clear this notebook again.\n",
"- Save the notebook.\n",
"- Close this notebook correctly.\n",
"- Shutdown Jupyter notebook. Reopen Jupyter notebook and open the notebook 03_Variables_Assignment."
]
},
{
Expand Down
Loading