Loading...

The Letter Ledger

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 Python class called CharFrequency that accepts a string on initialization. It should have a method get_counts() that returns a list of (character, count) tuples sorted alphabetically by character. Spaces should be ignored.

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.