Referenced from lesson Data Displays and Lookups (Spring, 2021)

The table below represents four pets:

pets-table

name sex age pounds

"Toggle"

"female"

3

48

"Fritz"

"male"

4

92

"Nori"

"female"

6

35.3

"Maple"

"female"

3

51.6

1 Match each Lookup Question (left) to the code that will give the answer (right).

“How much does Maple weigh?”

1

A

pets-table.row-n(3)

“Which is the last row in the table?

2

B

pets-table.row-n(2)["name"]

“What is Fritz’s sex?”

3

C

pets-table.row-n(1)["sex"]

“What’s the third animal’s name?”

4

D

pets-table.row-n(3)["age"]

“How much does Nori weigh?”

5

E

pets-table.row-n(3)["pounds"]

“How old is Maple?”

6

F

pets-table.row-n(0)

“What is Toggle’s sex?”

7

G

pets-table.row-n(2)["pounds"]

“What is the first row in the table?”

8

H

pets-table.row-n(0)["sex"]

2 Fill in the blanks (left) with code that will produce the value (right).

a.

pets-table.row-n(3)["name"]

"Maple"

b.

"male"

c.

4

d.

48

e.

"Nori"

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). CCbadge 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.