Skip to content

Commit 7b4e48b

Browse files
Add = vs == slide
1 parent dba2db0 commit 7b4e48b

File tree

1 file changed

+49
-5
lines changed

1 file changed

+49
-5
lines changed

published/csci_1101/week_03/monday/slides.md

+49-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ color: bowdoin-title
3232

3333
<br>
3434

35-
#### In Python, they are always capitalized: `True` and `False`.
35+
#### In Python, they are always capitalized as `True` and `False`.
3636

3737
<br>
3838

@@ -54,7 +54,11 @@ color: bowdoin
5454

5555
<br>
5656

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>
5862

5963
<twemoji-thinking-face v-drag="[825,376,90,90]" />
6064

@@ -75,13 +79,53 @@ color: bowdoin-title
7579

7680
| Human Operator | Python Symbol | Example Expression |
7781
| :----------------------: | :-----------: | :----------------: |
78-
| Equal to | `==` | `5 == 5.0` |
82+
| Equal to | <span v-mark="{ at: '+1', color: '#f00', type: 'box' }">`==`</span>| `5 == 5.0` |
7983
| Not equal to | `!=` | `True != False` |
8084
| Greater than | `>` | `7.0 > 3` |
8185
| Less than | `<` | `"A" < "B"` |
8286
| Greater than or equal to | `>=` | `4 >= 4` |
8387
| Less than or equal to | `<=` | `3.5 <= 5.0` |
8488

89+
---
90+
layout: side-title
91+
titlewidth: is-2
92+
align: cm-lm
93+
color: bowdoin-title
94+
---
95+
96+
:: title ::
97+
98+
# = vs ==
99+
100+
:: content ::
101+
102+
## 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+
85129
---
86130
layout: top-title
87131
color: bowdoin-title
@@ -135,15 +179,15 @@ color: bowdoin-title
135179

136180
:: content ::
137181

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.
139183

140184
<br>
141185

142186
#### `if` statements can evaluate <u>any</u> `True` or `False` expression!
143187

144188
<br>
145189

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!
147191

148192

149193
```python {monaco-run} {autorun:true, editorOptions: { lineNumbers:'on', fontSize:14}}

0 commit comments

Comments
 (0)