You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: published/csci_1101/week_03/monday/slides.md
+49-5
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ color: bowdoin-title
32
32
33
33
<br>
34
34
35
-
#### In Python, they are always capitalized:`True` and `False`.
35
+
#### In Python, they are always capitalized as`True` and `False`.
36
36
37
37
<br>
38
38
@@ -54,7 +54,11 @@ color: bowdoin
54
54
55
55
<br>
56
56
57
-
#### By themselves? Probably not very often.. However, `True` and `False` are used heavily because they are the result of a new type of expression!
57
+
<v-click>
58
+
59
+
<h4>By themselves? Probably not very often.. However, `True` and `False` are used heavily because they are the result of a new type of expression!</h4>
60
+
61
+
</v-click>
58
62
59
63
<twemoji-thinking-facev-drag="[825,376,90,90]" />
60
64
@@ -75,13 +79,53 @@ color: bowdoin-title
75
79
76
80
| Human Operator | Python Symbol | Example Expression |
## There are two ways we use the *"equals"* operator.
103
+
104
+
<br>
105
+
106
+
```python
107
+
x =5
108
+
```
109
+
110
+
111
+
### `=` tells the computer to set the value in `x` equal to `5`.
112
+
### We call this the ==assignment== operator!
113
+
114
+
<br>
115
+
<hr>
116
+
<br>
117
+
118
+
```python
119
+
x ==5
120
+
```
121
+
122
+
### `=` asks the computer to check if `x` is equal to `5`.
123
+
### We call this the ==equal-to== operator!
124
+
125
+
<br>
126
+
127
+
# It is critical that you do not mix these up!
128
+
85
129
---
86
130
layout: top-title
87
131
color: bowdoin-title
@@ -135,15 +179,15 @@ color: bowdoin-title
135
179
136
180
:: content ::
137
181
138
-
#### An `if` statement, also called a "conditional" statement, allows us to ask questions about the state of data and *"conditionally"* execute code based the result.
182
+
#### An `if` statement, also called a ==conditional== statement, allows us to ask questions about the state of data and *"conditionally"* execute code based the result.
139
183
140
184
<br>
141
185
142
186
#### `if` statements can evaluate <u>any</u> `True` or `False` expression!
143
187
144
188
<br>
145
189
146
-
#### Any indented code under the if statement only executes if the expression (also called the condition) evaluates to `True`. If the condition is `False`, the code doesn't run!
190
+
#### The indented code under an `if` statement only executes if the expression (called the ==condition==) evaluates to `True`. If the condition is `False`, the code doesn't run!
0 commit comments