|
1 | 1 | { |
2 | 2 | "cells": [ |
3 | 3 | { |
| 4 | + "attachments": {}, |
4 | 5 | "cell_type": "markdown", |
5 | 6 | "metadata": {}, |
6 | 7 | "source": [ |
7 | 8 | "# Reading Python\n", |
8 | 9 | "- This notebooks goal is not to produce python code, but an introduction on to to make sense of (read) code.\n", |
9 | | - " - we will go through and learn some Python terminology and structure. \n", |
| 10 | + " - we will go through and learn some Python terminology and structure.\n", |
| 11 | + " - You can install Python on your computer and write code form scratch, but this is time intensive and not necessary when getting started\n", |
| 12 | + " - Jupyter Notebooks and Colab are computational notebooks workbook where you can run code in your browser. There are many computational notebooks used in workshops and online books. \n", |
| 13 | + " - For more on Computational notebooks see this page, [JupyterLab & Notebooks](https://southernmethodistuniversity.github.io/intro-to-python/jupyterlab.html)\n", |
| 14 | + " \n", |
10 | 15 | "\n", |
11 | 16 | "\n" |
12 | 17 | ] |
|
15 | 20 | "cell_type": "markdown", |
16 | 21 | "metadata": {}, |
17 | 22 | "source": [ |
| 23 | + "# Reading Left to Right and Right to Left\n", |
18 | 24 | "Python has a syntax… \n", |
19 | 25 | "….and it builds on what happened immediately before, line by line. \n", |
20 | 26 | "So the value of y depends on what happened just before.\n", |
21 | 27 | "\n", |
22 | | - " <img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/readpy.png\" alt=\"Open Jupyter Lab\"/>" |
| 28 | + " <img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/readpy.png\" alt=\"reading python\"/>" |
23 | 29 | ] |
24 | 30 | }, |
25 | 31 | { |
|
36 | 42 | "cell_type": "markdown", |
37 | 43 | "metadata": {}, |
38 | 44 | "source": [ |
39 | | - "Reading Left to Right and Right to Left\n", |
| 45 | + "- Human thinking → left to right.\n", |
| 46 | + "- Left to right: You read the line of code like a sentence: x = 0 + 1 means “x equals 0 plus 1.”\n", |
40 | 47 | "\n", |
41 | | - "Human thinking → left to right.\n", |
42 | | - "Left to right: You read the line of code like a sentence: x = 0 + 1 means “x equals 0 plus 1.”\n", |
| 48 | + "- Computer execution → right side first, then assign left.\n", |
| 49 | + "- Right to left: Python evaluates the right side first (0 + 1), and then stores that result into the variable on the left (x).\n" |
| 50 | + ] |
| 51 | + }, |
| 52 | + { |
| 53 | + "cell_type": "markdown", |
| 54 | + "metadata": {}, |
| 55 | + "source": [ |
| 56 | + "# Variables\n", |
43 | 57 | "\n", |
44 | | - "Computer execution → right side first, then assign left.\n", |
45 | | - "Right to left: Python evaluates the right side first (0 + 1), and then stores that result into the variable on the left (x).\n" |
| 58 | + "A variable is like a tiny container where you store values and data\n", |
| 59 | + "- Filenames\n", |
| 60 | + "- Words\n", |
| 61 | + "- Numbers\n", |
| 62 | + "- Collections of words and numbers\n", |
| 63 | + "- Etc.\n" |
46 | 64 | ] |
47 | 65 | }, |
48 | 66 | { |
49 | 67 | "cell_type": "markdown", |
50 | 68 | "metadata": {}, |
51 | | - "source": [] |
| 69 | + "source": [ |
| 70 | + "# Some useful vocabulary for python\n", |
| 71 | + " <img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/vocabpy1.png\" alt=\"Python Vocabulary 1\"/>" |
| 72 | + ] |
| 73 | + }, |
| 74 | + { |
| 75 | + "attachments": {}, |
| 76 | + "cell_type": "markdown", |
| 77 | + "metadata": {}, |
| 78 | + "source": [ |
| 79 | + "# Examples \n", |
| 80 | + "\n", |
| 81 | + "<img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/readindex.gif\" alt=\"reading index\"/>\n", |
| 82 | + "\n", |
| 83 | + "- Let's go though and read what this code is doing\n", |
| 84 | + "\n", |
| 85 | + "<img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/readindex1.png\" alt=\"Python Vocabulary\"/>\n", |
| 86 | + "\n", |
| 87 | + "<img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/readindex2.png\" alt=\"Python Vocabulary\"/>\n", |
| 88 | + "\n", |
| 89 | + "<img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/readindex3.png\" alt=\"Python Vocabulary\"/>\n", |
| 90 | + "\n", |
| 91 | + "<img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/readindex4.png\" alt=\"Python Vocabulary\"/>\n", |
| 92 | + "\n", |
| 93 | + "<img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/readindex5.png\" alt=\"Python Vocabulary\"/>" |
| 94 | + ] |
| 95 | + }, |
| 96 | + { |
| 97 | + "cell_type": "markdown", |
| 98 | + "metadata": {}, |
| 99 | + "source": [ |
| 100 | + "# Some more useful vocabulary for python\n", |
| 101 | + " <img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/vocabpy2.png\" alt=\"Python Vocabulary 2\"/>" |
| 102 | + ] |
52 | 103 | }, |
53 | 104 | { |
54 | 105 | "cell_type": "markdown", |
55 | 106 | "metadata": {}, |
56 | 107 | "source": [ |
57 | 108 | "- References\n", |
58 | | - "- \n", |
| 109 | + "\n", |
59 | 110 | "[Introduction to Cultural Analytics & Python, Designed by Melanie Walsh](https://melaniewalsh.github.io/Intro-Cultural-Analytics/welcome.html)\n", |
60 | 111 | "\n" |
61 | 112 | ] |
|
0 commit comments