Grade from Score
Write a function that maps a numeric score to its letter grade using standard grading thresholds.
Map, Filter, Reduce
Implement three functions using map, filter, and reduce to manipulate a list of integers.
Isomorphic Strings Check
Given two strings, check if they are isomorphic by verifying a one-to-one character mapping.
Substring Anagrams
Return all start indices in a string where a substring of length k is an anagram of a pattern string.
One Hot Encode Labels
Given a list of categorical labels, return a list of one-hot encoded vectors based on the sort order of unique labels.
Average Salary by Department
Given a list of employee tuples (name, department, salary), return a dictionary mapping each department to its average salary.
Word frequency
Return a dict mapping each word to its count in the sentence.
Word to Index Map
Create a function that returns a dictionary mapping each unique word to the index of its first occurrence.
Group names by first letter
Given a list of names, return a dictionary mapping each first letter to all names starting with that letter in original order.
Keys Sorted by Value Descending
Given a dictionary mapping strings to integers, return a list of keys sorted by value descending, and when values tie, alphabetically ascending.
Top k keys by count
Given a dictionary mapping keys to counts, return the top k keys with the highest counts, breaking ties alphabetically.
Replace keys with a mapping
Write a function that renames keys in a dictionary according to a mapping, with duplicate handling.
Two Sum with Dict
Implement the classic Two Sum problem: return indices of two numbers that add up to a target using a dict.
Pair with difference K
Count unordered index pairs with absolute difference exactly K, handling duplicates correctly.
Count Pairs with Sum
Implement a function that counts the number of distinct pairs in a list summing to a target.
Hash map merge
Write a function that merges two dictionaries recursively, combining values and preserving structure.
Longest Harmonious Subsequence
Given a list of integers, find the length of the longest harmonious subsequence where the difference between maximum and minimum values is exactly 1.
Class Method Factory
Create a class method factory that dynamically adds methods to a class based on a mapping of names to behaviors.
Count pairs with given difference
Count how many unordered pairs in a list have a given absolute difference using an efficient approach.
Decode Ways
Count the number of ways to decode a numeric string into letters using the mapping A=1 to Z=26.
Employees earning more than manager
Given employee records with manager IDs, find those who earn more than their direct manager.
Generator Pipeline
Implement a generator function that yields only even numbers from an input list, squared.
Longest Arithmetic Subsequence
Given a list of integers, return the length of the longest arithmetic subsequence (constant difference) within it.
Delete and Earn
Given an array of integers, find the maximum points you can earn by repeatedly deleting a number and all its adjacent values.
Showing 1–24 of 36 challenges
Guide: free Python coding challenges
Practice Python by solving problems
PythonSkillset challenges are hands-on coding exercises from beginner to advanced. Open a challenge, read the problem, write Python in the split-pane editor, and run tests with Pyodide — no install required.
How to use the arena
- Pick a category — basics, algorithms, strings, and more
- Open a challenge, read the statement, and edit the starter code
- Run tests, fix failures, then try a related quiz or tutorial lesson
Challenges vs tutorials and quizzes
Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.