|
4 | 4 | "cell_type": "markdown", |
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | | - "#Numbers and more in Python!\n", |
| 7 | + "# Numbers and more in Python!\n", |
8 | 8 | "\n", |
9 | 9 | "In this lecture, we will learn about numbers in Python and how to use them.\n", |
10 | 10 | "\n", |
|
30 | 30 | "\n", |
31 | 31 | "Throughout this course we will be mainly working with integers or simple float number types.\n", |
32 | 32 | "\n", |
33 | | - "Here is a table of the two main types we will spend most of our time working with some examples:\n", |
34 | | - "\n", |
35 | | - "<table border = “1“>\n", |
36 | | - "<caption>Numbers in Python</caption> \n", |
| 33 | + "Here is a table of the two main types we will spend most of our time working with some examples:" |
| 34 | + ] |
| 35 | + }, |
| 36 | + { |
| 37 | + "cell_type": "markdown", |
| 38 | + "metadata": {}, |
| 39 | + "source": [ |
| 40 | + "<table>\n", |
37 | 41 | "<tr>\n", |
38 | | - " <th>Examples</th> <th>Number \"Type\"</th>\n", |
| 42 | + " <th>Examples</th> \n", |
| 43 | + " <th>Number \"Type\"</th>\n", |
39 | 44 | "</tr>\n", |
40 | | - "<td>1,2,-5,1000</td> <td>Integers</td> \n", |
| 45 | + "\n", |
41 | 46 | "<tr>\n", |
| 47 | + " <td>1,2,-5,1000</td>\n", |
| 48 | + " <td>Integers</td> \n", |
42 | 49 | "</tr>\n", |
43 | | - "<td>1.2,-0.5,2e2,3E2</td> <td>Floating-point numbers</td> \n", |
| 50 | + "\n", |
44 | 51 | "<tr>\n", |
| 52 | + " <td>1.2,-0.5,2e2,3E2</td> \n", |
| 53 | + " <td>Floating-point numbers</td> \n", |
45 | 54 | "</tr>\n", |
46 | | - " </table>\n", |
47 | | - " \n", |
| 55 | + " </table>" |
| 56 | + ] |
| 57 | + }, |
| 58 | + { |
| 59 | + "cell_type": "markdown", |
| 60 | + "metadata": {}, |
| 61 | + "source": [ |
48 | 62 | " \n", |
49 | 63 | " \n", |
50 | 64 | "Now let's start with some basic arithmetic." |
|
155 | 169 | "source": [ |
156 | 170 | "### <font color='red'>Python 3 Alert!</font>\n", |
157 | 171 | "\n", |
158 | | - "**Woah! What just happened? Last time I checked, 3 divided by 2 is equal 1.5 not 1!**\n", |
| 172 | + "**Whoa! What just happened? Last time I checked, 3 divided by 2 is equal 1.5 not 1!**\n", |
159 | 173 | "\n", |
160 | 174 | "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", |
161 | 175 | "\n", |
|
280 | 294 | "cell_type": "markdown", |
281 | 295 | "metadata": {}, |
282 | 296 | "source": [ |
283 | | - "When you import division from the __future__ you won't need to worry about classic division occuring anymore anywhere in your code!" |
| 297 | + "When you import division from the __future__ you won't need to worry about classic division occurring anymore anywhere in your code!" |
284 | 298 | ] |
285 | 299 | }, |
286 | 300 | { |
|
606 | 620 | } |
607 | 621 | ], |
608 | 622 | "metadata": { |
| 623 | + "anaconda-cloud": {}, |
609 | 624 | "kernelspec": { |
610 | | - "display_name": "Python 2", |
| 625 | + "display_name": "Python [conda root]", |
611 | 626 | "language": "python", |
612 | | - "name": "python2" |
| 627 | + "name": "conda-root-py" |
613 | 628 | }, |
614 | 629 | "language_info": { |
615 | 630 | "codemirror_mode": { |
616 | 631 | "name": "ipython", |
617 | | - "version": 2 |
| 632 | + "version": 3 |
618 | 633 | }, |
619 | 634 | "file_extension": ".py", |
620 | 635 | "mimetype": "text/x-python", |
621 | 636 | "name": "python", |
622 | 637 | "nbconvert_exporter": "python", |
623 | | - "pygments_lexer": "ipython2", |
624 | | - "version": "2.7.10" |
| 638 | + "pygments_lexer": "ipython3", |
| 639 | + "version": "3.5.3" |
625 | 640 | } |
626 | 641 | }, |
627 | 642 | "nbformat": 4, |
|
0 commit comments