Loading...

The Price Bander

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
mid, senior

Problem

Write a function that takes a dict mapping product names to prices. Using a dict comprehension, return a new dict mapping each product name to its price tier: 'low' if price < 10, 'mid' if price < 50, and 'high' otherwise.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.