-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstage2.html
256 lines (255 loc) · 7.56 KB
/
stage2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<head>
<title>Jeff's Notes</title>
<link rel="stylesheet" href="css/main.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="toc">
<h1>Table of Contents</h1>
<ul>
<li class="toc-lesson"><a href="#lesson-1">Introduction to "Serious"
Programming</a>
<ul>
<li><a href="#comp">Computer</a></li>
<li><a href="#program">Program</a></li>
<li><a href="#prolang">Programming Languages</a></li>
<li><a href="#interpreter">Interpreter</a></li>
<li><a href="#python">Python</a></li>
<li><a href="#grammer">Grammer</a></li>
<li><a href="#pythonexp">Python Expression</a></li>
</ul>
</li>
<li class="toc-questions"><a href="#questions22">Questions Lesson 2.2: Variables and Strings</a>
<uL>
<li><a href="#asignvariable">How do you assign a value to a variable
in Python?</a></li>
<li><a href="#equals">What is the difference in the = in
programming then in regular math?</a></li>
<li><a href="#variables">How can variables make you life easier
as a programmer?</a></li>
<li><a href="#string">How is a string identified in Python?</a></li>
<li><a href="#stringfunct">What are some string functions/methods/procedures
in Python?</a></li>
</ul>
</li>
<li class="toc-questions"><a href="#questions23">Questions Lesson 2.3: Input->Function->Output</a>
<uL>
<li><a href="#functions">What are functions?</a></li>
<li><a href="#howfunctions">How do you make and use a function?</a></li>
<li><a href="#funcandrepetition">How do functions help programmers avoid
repetition?</a></li>
<li><a href="#return">What is a return statement in a function?</a></li>
</ul>
</li>
</ul>
</div>
<h1>Important Concepts</h1>
<div class="lesson">
<h2 id="lesson-1">Lesson 2.1: Introduction to Serious Programming</h2>
<div class="concept" id="comp">
<div class="concept-title">
Computer
</div>
<div class="concept-description">
<p>
Unlike a toaster that can basically do one thing toast bread
pastries etc... Computers can do anything with programming.
Without any programs computers are useless.
</p>
</div>
</div>
<div class="concept" id="program">
<div class="concept-title">
Program
</div>
<div class="concept-description">
<p>
Programs are what make a computer do stuff.
</p>
<p>
Think like a programmer: think procedurally, be an abstract
thinker, be systems thinker, have technological empathy, and
be a debugger.
</p>
</div>
</div>
<div class="concept" id="prolang">
<div class="concept-title">
Programming Languages
</div>
<div class="concept-description">
<p>
There are many different types of programming languages and the
one we will be using is python. The reason why we do not use a
language such as english or spanish is because of ambiguity and
verbosity. Computers need precise step by step instruction to
do what you want them to do.
</p>
</div>
</div>
<div class="concept" id="interpreter">
<div class="concept-title">
Interpreter
</div>
<div class="concept-description">
<p>
Python uses an interpreter to do what we want the program to do.
</p>
</div>
</div>
<div class="concept" id="python">
<div class="concept-title">
Python
</div>
<div class="concept-description">
<p>
Python is a high level language meaning they are closer to the
human languages than a machine language.
</p>
</div>
</div>
<div class="concept" id="grammer">
<div class="concept-title">
Grammer
</div>
<div class="concept-description">
<p>
Python uses Backus Naur form. Where a non-terminal is like a
noun, verb, object, subject etc... A terminal would be python,
eat, etc...
</p>
<p>
</p>
</div>
</div>
<div class="concept" id="pythonexp">
<div class="concept-title">
Python Expresion
</div>
<div class="concept-description">
<p>
Python expresion can be in the form of 1 * 1, 1 - 4, 1+3 etc...
Using the Backus Naur form a non-terminal would be expression,
operator and the terminal would be 1, -, + () etc...
</p>
</div>
</div>
</div>
<div class="questions">
<h2 id="questions22">Questions Lesson 2.2: Variables and Strings</h2>
<div class="question" id="asignvariable">
<div class="actual-question">
How do you assign a value to a variable in Python?
</div>
<div class="question-answer">
<p>
Name = Expression
</p>
</div>
</div>
<div class="question" id="equals">
<div class="actual-question">
What is the difference in the = in programming then in regular math?
</div>
<div class="concept-description">
<p>
In programming the = is usually used to assign a value.
</p>
</div>
</div>
<div class="question" id="variables">
<div class="actual-question">
How can variables make you life easier as a programmer?
</div>
<div class="question-answer">
<p>
There are many reasons to use variables here are a few: easier
to identify what numbers mean in expression, making for easier
to read code. Makes it so you can use that data in other places
in your code.
</p>
</div>
</div>
<div class="question" id="string">
<div class="actual-question">
How is a string identified in Python?
</div>
<div class="question-answer">
<p>
A string in Python is identified with single quotes 'string' or
double quotes "string".
</p>
</div>
</div>
<div class="question" id="stringfunct">
<div class="actual-question">
What are some string functions/methods/procedures in Python?
</div>
<div class="question-answer">
<p>
Find is used to find the position of a character and returns
the position number. <br>
<string>.find(<string>)<br>
ex1: 'string'.find('s') # this returns 0<br>
ex2: 'string'.find('g') # this returns 5<br>
ex3: 'string'.find('a') # returns -1 if it cannot find<br>
<string>.find(<string>,<number>)<br>
ex4: 'strings'.find('s',1) # starts the search at position 1 this returns 6<br>
</p>
</div>
</div>
</div>
<div class="questions">
<h2 id="questions23">Questions Lesson 2.3: Input->Function->Output</h2>
<div class="question" id="functions">
<div class="actual-question">
What are functions?
</div>
<div class="question-answer">
<p>
Functions are blocks of code that allow the programmer to do
particular job that can be done over and over...
</p>
</div>
</div>
<div class="question" id="howfunctions">
<div class="actual-question">
How do you make and use a function?
</div>
<div class="concept-description">
<p>
In Python you use the following format to make a function:<br>
<span style="color: blue;">def</span> name(par1, par2...):<br>
par1 = par1 + par1<br>
return par1<br>
To call a function you use the following:<br>
name(par1,par2)
</p>
</div>
</div>
<div class="question" id="funcandrepetition">
<div class="actual-question">
How do functions help programmers avoid repetition?
</div>
<div class="question-">
<p>
Functions are great because they only have to write them once
and can reuse them over and over again throughout the program.
</p>
</div>
</div>
<div class="question" id="return">
<div class="actual-question">
What is a return statement in a function?
</div>
<div class="question-answer">
<p>
The return statement in a function allows you to send something
to the program for future use.
</p>
</div>
</div>
</div>
</body>
</html>