Beginner Coding with Blocks
Chapter
>
Level
Advanced Lists and Data Structures
Advanced List Operations
Objective
Go through all the crates in the shed and remove junk from each crate.
The crates in the shed are a mess, each crate holds a nested list structure (dictionary) which has undesired items inside. These items include: "Pipes", "Screws" and "Bolts". When working with nested lists and dictionary-like structures, there's an easy way to remove items from them by accessing their key.
Use the speak block with the crate variable to see what items are inside each crate. Then use the delete key block to remove unwanted items. The delete key block takes the crate variable and the key (item name) you want to remove.
There are five nested list constants in this level: crate1, crate2, crate3, crate4 and crate5. Walk to the X marks in front of each crate and use the speak block with each crate variable so you can read out what items are inside of the crate. Use the delete key block to remove any "Pipes", "Screws" and "Bolts" found in each crate.