Spring 2025 Quiz 1

← return to practice.dsc10.com


This quiz was administered in-person. It was closed-book; students were not allowed to use the DSC 10 Reference Sheet but were allowed a double-sided sheet of handwritten notes. Students had 20 minutes to work on the quiz.

This quiz covered Lectures 1-5 of the Spring 2025 offering of DSC 10.


In the video game Minecraft, players mine raw materials, craft various tools, and build structures such as houses.
A player named Steve has several storage chests in which he keeps items he owns. Each chest has a different descriptive name and contains items of various types. For example, one of Steve’s chests is called "Food" and it contains 12 "Golden Carrot" and 8 "Rabbit Stew" items.

The items DataFrame contains all the items Steve has in his chests. It is indexed by "Item" (name of the item). The columns are "Quantity" (number of such items) and "Chest" (name of the chest where all such items are stored). The first few rows are shown below, though items has more rows than pictured.


Problem 1

Fill in the blanks so the expression below evaluates to the name of the chest that contains the most distinct items.


    (items.groupby(___(a)___).___(b)___
          .sort_values(by="Quantity", ascending=___(c)___).___(d)___)

Answer:

  • (a) "Chest"
  • (b) count()
  • (c) False
  • (d) index[0]

  1. Difficulty: ⭐️⭐️

    The average score on this problem was 89%.


  2. Difficulty: ⭐️⭐️⭐️⭐️

    The average score on this problem was 39%.


  3. Difficulty: ⭐️⭐️

    The average score on this problem was 86%.


  4. Difficulty: ⭐️⭐️⭐️

    The average score on this problem was 67%.


Problem 2

Steve wants to build a village where each house is built using a different "Item" from the "Materials" chest (e.g., a cobblestone house, a wood house, a brick house, etc). Assuming that each house requires at least 416 blocks of a single material, fill in the blanks so that the expression below evaluates to the number of houses that Steve’s village will have.

    items[(___(a)___) & (___(b)___)].___(c)___

Answer:

  • (a) items.get("Chest") == "Materials"
  • (b) items.get("Quantity") >= 416
  • (c) shape[0]

Note that answer (a) and (b) may be swapped.


  1. Difficulty: ⭐️⭐️⭐️

    The average score on this problem was 71%.


  2. Difficulty: ⭐️⭐️⭐️

    The average score on this problem was 71%.


  3. Difficulty: ⭐️⭐️⭐️⭐️⭐️

    The average score on this problem was 27%.


Problem 3

Which of the following expressions evaluates to the number of "Emerald"s in Steve’s chests? Select all that apply.

Answer:

Option 1 and Option 4


Difficulty: ⭐️⭐️

The average score on this problem was 78%.


Problem 4

In early versions of Minecraft, players reported sighting a hazy figure with glowing eyes, who they nicknamed Herobrine. Examine the mysterious code that Herobrine left behind and determine the output. Write your answer exactly how the output would appear in Python. Do it wrong and your diamonds will disappear.

    curse = 3 + 4 * 2 ** 2 - 6/3
    curse

Answer: 17.0


Difficulty: ⭐️⭐️

The average score on this problem was 85%.


Problem 5

Below is the opening line from the legendary Minecraft parody song

Revenge:


    line = "Creeper aww man"

You want to create an echo effect to produce the following string:

    "Creeper Creeper Creeper aww man"

Which of the following code snippets produces this output? Select all that apply.

Answer:

Option 1 and Option 3


Difficulty: ⭐️

The average score on this problem was 93%.


👋 Feedback: Find an error? Still confused? Have a suggestion? Let us know here.