Loading...

The Bonus Round

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

Domain
Python
Difficulty
medium
Seniority
junior, mid

Problem

Given a list of dice rolls, compute the total score using this rule: each roll adds its face value, but if two consecutive rolls show the same value, add a bonus equal to double that value (in addition to counting both rolls normally). Return the final score.

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.