The table below represents four pets at an animal shelter:

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

row-n(pets-table, 3)

“Which is the last row in the table?

2

B

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

“What is Fritz’s sex?”

3

C

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

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

4

D

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

“How much does Nori weigh?”

5

E

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

“How old is Maple?”

6

F

row-n(pets-table, 0)

“What is Toggle’s sex?”

7

G

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

“What is the first row in the table?”

8

H

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

2 For each value on the left, write the Pyret expression that will produce that value on the right. The first one has been completed for you.

a.

"Maple"

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

b.

"male"

c.

4

d.

48

e.

"Nori"

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