A strange line appears in the comms log: lights are now dim. "That is odd," Rocket says. "The lights are fine."
Raven writes the four words in a column. "What do you notice about the first letter of each word?" she asks.
Rocket reads them down the side. "L, A, N, D. Land! It is a secret message from the shuttle!" Nova does a happy loop. "Great discovery! Would you like a hint? A loop could find the first letters for us."
This program splits the log line into words.
The loop appends the first letter of each word to a list.
Then join glues the letters together, and upper makes them capitals.
log = "lights are now dim"
letters = []
for w in log.split():
letters.append(w[0])
print("".join(letters).upper()) | The screen shows |
|---|
| LAND |
| Round | w | letters after the round |
|---|---|---|
| 1 | lights | ['l'] |
| 2 | are | ['l', 'a'] |
| 3 | now | ['l', 'a', 'n'] |
| 4 | dim | ['l', 'a', 'n', 'd'] |
Rocket made one small change. Now the decoder shows only L.
log = "lights are now dim"
letters = []
for w in log.split(","):
letters.append(w[0])
print("".join(letters).upper()) | Change to the working decoder | Would the screen still show LAND? |
|---|---|
| Change "".join to "-".join | ? |
| Take out upper() | ? |
| Rename letters to marks on every line | ? |
log = "bus hat sofa car"
letters = []
for w in log.split():
letters.append(w[-1])
print("".join(letters).upper()) | Change to the last-letter decoder | Would the screen still show STAR? |
|---|---|
| Change w[-1] to w[0] | ? |
| Change "".join to " ".join | ? |
| Change the log to "plus melt tuna door" | ? |
| Take out .upper() | ? |
Week six is done, Crew Engineer! You can split, join and decode. Next week, a new kind of container will make the cargo inventory easy.