Challenge - 5 Problems
Tool Library Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of tool library list command
What is the output of the following command that lists all tools in the CNC tool library?
CNC Programming
list_tools()
Attempts:
2 left
💡 Hint
Think about what a tool library list command should return if tools are registered.
✗ Incorrect
The command list_tools() returns a list of all tools currently registered in the tool library with their properties.
📝 Syntax
intermediate2:00remaining
Correct syntax to add a tool to the library
Which of the following commands correctly adds a new drill tool with diameter 8 to the tool library?
Attempts:
2 left
💡 Hint
Check the correct use of named parameters in the function call.
✗ Incorrect
The function requires named parameters for type and diameter. Option C uses correct syntax.
🔧 Debug
advanced2:00remaining
Identify the error in tool removal script
What error will this script produce when trying to remove a tool by ID from the library?
remove_tool(5)
print('Tool removed')
CNC Programming
remove_tool(5) print('Tool removed')
Attempts:
2 left
💡 Hint
Consider what happens if the tool ID does not exist in the library.
✗ Incorrect
If tool ID 5 does not exist, the function raises a KeyError indicating the tool was not found.
🚀 Application
advanced2:00remaining
Result of updating tool diameter
After running this script to update the diameter of tool ID 2 to 7, what is the diameter of tool ID 2?
CNC Programming
update_tool(2, diameter=7) result = get_tool(2)['Diameter'] print(result)
Attempts:
2 left
💡 Hint
The update_tool function changes the tool's properties if the ID exists.
✗ Incorrect
The diameter is updated to 7, so get_tool returns the updated diameter.
🧠 Conceptual
expert2:00remaining
Number of tools after batch import
If the tool library initially has 3 tools and you run a batch import script that adds 4 new tools but removes 2 existing tools, how many tools are in the library after the script?
Attempts:
2 left
💡 Hint
Add the new tools and subtract the removed tools from the initial count.
✗ Incorrect
Starting with 3, adding 4 makes 7, removing 2 leaves 5 tools.
