Loading...
Dice Roll Scoring
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- senior
Problem
Our game engine's scoring module needs a dice hand evaluator. Write a function that takes 5 dice values (1-6) and returns the best score: five-of-a-kind = 50, four-of-a-kind = 40, full house = 25, three-of-a-kind = sum of all dice, otherwise = sum of all dice.
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.