|
218 | 218 | "alist[0] = 7 # Since alist is a list, you can change values \n",
|
219 | 219 | "print('modified alist', alist)\n",
|
220 | 220 | "#btuple[0] = 100 # Will give an error\n",
|
221 |
| - "#print 2*alist" |
| 221 | + "#print(2 * alist)" |
222 | 222 | ]
|
223 | 223 | },
|
224 | 224 | {
|
225 | 225 | "cell_type": "markdown",
|
226 | 226 | "metadata": {},
|
227 | 227 | "source": [
|
228 |
| - "Lists and tuples are versatile data types in Python. We already used lists without realizing it when we created our first array with the command `np.array([1, 7, 2, 12])`. What we did is we gave the `array` function one input argument: the list `[1, 7, 2, 12]`, and the `array` function returned a one-dimensional array with those values. Lists and tuples can consist of a sequences of pretty much anything, not just numbers. In the example given below, `alist` contains 5 *things*: the integer 1, the float 20, the word `python`, an array with the values 1,2,3, and finally, the function `len`. The latter means that `alist[4]` is actually the function `len`. That function can be called to determine the length of an array as shown below. The latter may be a bit confusing, but it is cool behavior if you take the time to think about it." |
| 228 | + "Lists and tuples are versatile data types in Python. We already used lists without realizing it when we created our first array with the command `np.array([1, 7, 2, 12])`. What we did is we gave the `array` function one input argument: the list `[1, 7, 2, 12]`, and the `array` function returned a one-dimensional array with those values. Lists and tuples can consist of a sequences of pretty much anything, not just numbers. In the example given below, `alist` contains 5 *things*: the integer 1, the float 20.0, the word `python`, an array with the values 1,2,3, and finally, the function `len`. The latter means that `alist[4]` is actually the function `len`. That function can be called to determine the length of an array as shown below. The latter may be a bit confusing, but it is cool behavior if you take the time to think about it." |
229 | 229 | ]
|
230 | 230 | },
|
231 | 231 | {
|
|
490 | 490 | "cell_type": "markdown",
|
491 | 491 | "metadata": {},
|
492 | 492 | "source": [
|
493 |
| - "It is important to understand the difference between one equal sign like `a=4` and two equal signs like `a==4`. One equal sign means assignment. Whatever is on the right side of the equal sign is assigned to what is on the left side of the equal sign. Two equal signs is a comparison and results in either `True` (when both sides are equal) or `False`." |
| 493 | + "It is important to understand the difference between one equal sign like `a = 4` and two equal signs like `a == 4`. One equal sign means assignment. Whatever is on the right side of the equal sign is assigned to what is on the left side of the equal sign. Two equal signs is a comparison and results in either `True` (when both sides are equal) or `False`." |
494 | 494 | ]
|
495 | 495 | },
|
496 | 496 | {
|
|
913 | 913 | "name": "python",
|
914 | 914 | "nbconvert_exporter": "python",
|
915 | 915 | "pygments_lexer": "ipython3",
|
916 |
| - "version": "3.7.6" |
| 916 | + "version": "3.8.2" |
| 917 | + }, |
| 918 | + "latex_envs": { |
| 919 | + "LaTeX_envs_menu_present": true, |
| 920 | + "autoclose": false, |
| 921 | + "autocomplete": true, |
| 922 | + "bibliofile": "biblio.bib", |
| 923 | + "cite_by": "apalike", |
| 924 | + "current_citInitial": 1, |
| 925 | + "eqLabelWithNumbers": true, |
| 926 | + "eqNumInitial": 1, |
| 927 | + "hotkeys": { |
| 928 | + "equation": "Ctrl-E", |
| 929 | + "itemize": "Ctrl-I" |
| 930 | + }, |
| 931 | + "labels_anchors": false, |
| 932 | + "latex_user_defs": false, |
| 933 | + "report_style_numbering": false, |
| 934 | + "user_envs_cfg": false |
917 | 935 | },
|
918 | 936 | "varInspector": {
|
919 | 937 | "cols": {
|
|
950 | 968 | }
|
951 | 969 | },
|
952 | 970 | "nbformat": 4,
|
953 |
| - "nbformat_minor": 1 |
| 971 | + "nbformat_minor": 4 |
954 | 972 | }
|
0 commit comments