Boolean-producing expressions are yes-or-no questions, and will always evaluate to either true
(“yes”) or false
(“no”).
What will the expressions below evaluate to? Write down your prediction, then type the code into the Interactions Area to see what it returns.
Prediction | Result | Prediction | Result | |||
---|---|---|---|---|---|---|
1 |
2 |
|||||
3 |
4 |
|||||
5 |
6 |
|||||
7 |
8 |
|||||
9 |
10 |
|||||
11 |
12 |
|||||
13 |
14 |
15 In your own words, describe what <
does.
16 In your own words, describe what >=
does.
17 In your own words, describe what <>
does.
Prediction: | Result: | |
---|---|---|
18 |
||
19 |
20 In your own words, describe what string-contains
does. Can you generate another expression using string-contains
that returns true?
★ There are infinite string values ("a", "aa", "aaa"…) and infinite number values out there (…-2,-1,0,-1,2… ). But how many different Boolean values are there?
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.