Skip to content

Commit 500c209

Browse files
authored
2nd update to match statements notebook
1 parent e897fb6 commit 500c209

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

match statements.ipynb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"metadata": {},
179179
"source": [
180180
"#### Conditionals in case \n",
181-
"*if* statements and *or* (using bar) are supported in case statements."
181+
"*or* conditions (using bar) are supported in case statements."
182182
]
183183
},
184184
{
@@ -198,7 +198,7 @@
198198
"var = 2\n",
199199
"\n",
200200
"match var:\n",
201-
" case x if x<=3:\n",
201+
" case 2 | 3:\n",
202202
" print('small')\n",
203203
" case 4 | 5 | 6:\n",
204204
" print('medium')\n",
@@ -211,6 +211,8 @@
211211
"metadata": {},
212212
"source": [
213213
"#### No breaks needed\n",
214+
"*if* statements are supported, but must follow syntax, case var if (inequality expression). \n",
215+
"\n",
214216
"Note that you do not need break statements. The match block will automatically end execution after one case is executed."
215217
]
216218
},
@@ -252,7 +254,8 @@
252254
"metadata": {},
253255
"source": [
254256
"#### Python Objects \n",
255-
"match statements can also use Python objects and instance variables."
257+
"Match statements can also use Python objects and instance variables. \n",
258+
"In the final case here we could have used _ default case, but instead used x so that we could use the value of x in our print statement."
256259
]
257260
},
258261
{

0 commit comments

Comments
 (0)