Loading...
The Balanced Sum
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- junior, mid
Problem
A game rewards players who collect items whose values are perfectly balanced. Write a function that takes an integer and returns True if it is a perfect number - one whose proper divisors sum exactly to itself. Return False 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.