BestPromptFinder
HomeCoding › Below is an instruction that describes a task. Write a respo...

Below is an instruction that describes a task. Write a respo...

Coding · General · Coding
58Quality
88%Useful
85Reliability

The prompt

Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: In Python, create a function to find the maximum value within a nested dictionary. ### Input: sample_dict = { "key1": { "value1": 10, "value2": 20 }, "key2": { "value3": 40 }, } ### Output: def findMaxValue(dict): max_val = None for key, value in dict.items(): if isinstance(value, dict): max_val = max(findMaxValue(value), max_val) else: max_val = max(value, max_val) return max_val print(findMaxValue(sample_dict))
Find similar in the app →

Why this prompt

Source

Hugging Face

Related Coding prompts

PRD to MVP Technical Plan
Quality 93 · Claude Code
Full-Stack CRUD App Builder
Quality 93 · Claude Code
Legacy Refactor Planner
Quality 93 · Claude Code
Test Suite Generator
Quality 93 · Claude Code
Third-Party API Integration
Quality 93 · Claude Code
Database Schema and Migration
Quality 93 · Claude Code