diff --git a/README.md b/README.md index 3ac6bef11e..8071eef7ef 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,13 @@ So far we have only worked with data -- strings, numbers, and booleans. In this "art vandelay" ``` + + + + 'art vandelay' + + + Now months later, if we see that string in some code, we may be confused as to what it's about. And when we add more data, this only becomes more difficult. Think of the what we saw in our **Data Types Lab**: `"art.vandelay@vandelay.co"`, `"Ceo"`, `"7285553334"`, `"vandelay.com"`. There's a lot to keep track of. So let's use a variables to indicate what each of these strings mean. @@ -66,6 +73,18 @@ Note that if you introduce a new variable, (declare it), but do not also assign name ``` + + ---------------------------------------------------------- + + NameError Traceback (most recent call last) + + in () + ----> 1 name + + + NameError: name 'name' is not defined + + So that error tells us that `name` is not defined. We just fix this by declaring `name` and assigning the variable in the same line. @@ -79,6 +98,7 @@ So this is assigning and reading a variable. And when we want to see some infor ```python email + ``` ### Reassigning variables diff --git a/index.ipynb b/index.ipynb index fb0c8de229..0eb5425084 100644 --- a/index.ipynb +++ b/index.ipynb @@ -60,9 +60,20 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'art vandelay'" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "\"art vandelay\"" ] @@ -78,7 +89,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 3, "metadata": { "collapsed": true }, @@ -147,9 +158,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'name' 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\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mname\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mNameError\u001b[0m: name 'name' is not defined" + ] + } + ], "source": [ "name" ] @@ -184,7 +207,7 @@ "metadata": {}, "outputs": [], "source": [ - "email" + "email\n" ] }, { @@ -343,7 +366,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 18, "metadata": { "collapsed": true }, @@ -371,9 +394,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [], "source": [ "name"