Skip to content

Commit c25d45d

Browse files
add read py
1 parent c903c1b commit c25d45d

File tree

11 files changed

+148
-12
lines changed

11 files changed

+148
-12
lines changed

docs/.ipynb_checkpoints/python-reading-checkpoint.ipynb

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,112 @@
11
{
22
"cells": [
33
{
4+
"attachments": {},
45
"cell_type": "markdown",
56
"metadata": {},
67
"source": [
7-
"# READING PYTHON\n",
8+
"# Reading Python\n",
89
"- This notebooks goal is not to produce python code, but an introduction on to to make sense of (read) code.\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",
15+
"\n",
916
"\n"
1017
]
1118
},
19+
{
20+
"cell_type": "markdown",
21+
"metadata": {},
22+
"source": [
23+
"# Reading Left to Right and Right to Left\n",
24+
"Python has a syntax… \n",
25+
"….and it builds on what happened immediately before, line by line. \n",
26+
"So the value of y depends on what happened just before.\n",
27+
"\n",
28+
" <img src=\"https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/images/readpy.png\" alt=\"reading python\"/>"
29+
]
30+
},
1231
{
1332
"cell_type": "code",
1433
"execution_count": null,
1534
"metadata": {},
1635
"outputs": [],
1736
"source": [
18-
"# [Slides for this session](https://raw.githubusercontent.com/SouthernMethodistUniversity/intro-to-python/main/files/intro-to-python-beginners.pdf)"
37+
"x = 0 + 1 # Python creates x and stores 1 in it\n",
38+
"y = x + 1 # Python uses the value of x (which is 1) to compute y = 2\n"
39+
]
40+
},
41+
{
42+
"cell_type": "markdown",
43+
"metadata": {},
44+
"source": [
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",
47+
"\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",
57+
"\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"
64+
]
65+
},
66+
{
67+
"cell_type": "markdown",
68+
"metadata": {},
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\"/>"
19102
]
20103
},
21104
{
22105
"cell_type": "markdown",
23106
"metadata": {},
24107
"source": [
108+
"- References\n",
109+
"\n",
25110
"[Introduction to Cultural Analytics & Python, Designed by Melanie Walsh](https://melaniewalsh.github.io/Intro-Cultural-Analytics/welcome.html)\n",
26111
"\n"
27112
]

docs/_toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ format: jb-book
55
root: index
66
chapters:
77
- file: quickstart
8-
- file: python_install
98
- file: python-reading
9+
- file: python_install
1010
- file: jupyterlab
1111
- file: jupyternotebook
1212
- file: python-basics-0

docs/python-reading.ipynb

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
{
22
"cells": [
33
{
4+
"attachments": {},
45
"cell_type": "markdown",
56
"metadata": {},
67
"source": [
78
"# Reading Python\n",
89
"- 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",
1015
"\n",
1116
"\n"
1217
]
@@ -15,11 +20,12 @@
1520
"cell_type": "markdown",
1621
"metadata": {},
1722
"source": [
23+
"# Reading Left to Right and Right to Left\n",
1824
"Python has a syntax… \n",
1925
"….and it builds on what happened immediately before, line by line. \n",
2026
"So the value of y depends on what happened just before.\n",
2127
"\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\"/>"
2329
]
2430
},
2531
{
@@ -36,26 +42,71 @@
3642
"cell_type": "markdown",
3743
"metadata": {},
3844
"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",
4047
"\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",
4357
"\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"
4664
]
4765
},
4866
{
4967
"cell_type": "markdown",
5068
"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+
]
52103
},
53104
{
54105
"cell_type": "markdown",
55106
"metadata": {},
56107
"source": [
57108
"- References\n",
58-
"- \n",
109+
"\n",
59110
"[Introduction to Cultural Analytics & Python, Designed by Melanie Walsh](https://melaniewalsh.github.io/Intro-Cultural-Analytics/welcome.html)\n",
60111
"\n"
61112
]

images/readindex.gif

1.75 MB
Loading

images/readindex1.png

77.3 KB
Loading

images/readindex2.png

76.3 KB
Loading

images/readindex3.png

75.9 KB
Loading

images/readindex4.png

77 KB
Loading

images/readindex5.png

75.8 KB
Loading

images/vocabpy1.png

30.5 KB
Loading

0 commit comments

Comments
 (0)