Referenced from lesson Data Displays and Lookups (Spring, 2021)
Consider the table below, and the four value definitions that follow:
shapes-table
name | corners | is-round |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
shapeA = shapes-table.row-n(0)
shapeB = shapes-table.row-n(1)
shapeC = shapes-table.row-n(2)
shapeD = shapes-table.row-n(3)
1 Match each Pyret expression (left) to the description of what it evaluates to (right).
|
1 |
A |
Evaluates to |
|
|
2 |
B |
Evaluates to the last row in the table |
|
|
3 |
C |
Evaluates to |
|
|
4 |
D |
Evaluates to |
|
|
5 |
E |
Evaluates to |
|
|
6 |
F |
Evaluates to |
|
|
7 |
G |
Evaluates to the first row in the table |
2 Fill in the blanks (left) with the Pyret lookup code that will produce the value (right).
a. |
|
|
b. |
|
|
c. |
|
|
d. |
|
|
e. |
|
|
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). Bootstrap:Data Science 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.