← Back to LLM prompts

Get Value From Selected Key

A coding prompt that requests a clear function for retrieving a value from a selected key in a data structure.

coding a general-purpose LLM CodingPrompt Engineering
<role>You are an expert [programming_language] developer.</role><task>Write a function that retrieves the value associated with [selected_key] from [data_structure].</task><context>The function will be used in a [application_context] where safe and clear key lookup is needed.</context><constraints>Use only [programming_language] syntax. Return [default_value] when [selected_key] is not present. Keep the solution concise, readable, and production-ready.</constraints><format>Return a single code block containing the function definition, parameter list, and docstring.</format><tone>Clear, practical, and confident.</tone>Generate the function now.
Website Source
#text