Count word occurrences
Write a function that takes a sentence and returns a dictionary of word counts.
Garbage Collection Hint
Write a function that predicts when an object is garbage collected based on reference counting.
Copy deep vs shallow
Predict and write a function that returns a copied list and inspect whether nested modification affects the original.
Parse environment variables
Write parse_env_vars that parses KEY=VALUE lines into a dict, converting booleans/numbers and ignoring comments.
Filter by Age
Filter a list of person dictionaries by age and return their names.
Rank Employees by Salary
Sort a list of employee dictionaries by salary descending, tie-break by name, and return ranked strings.
Most Common Character
Return the character that appears most frequently in a string, breaking ties by earliest occurrence.
Parse Log Line
Write a function that parses a log line and returns a dictionary with timestamp, level, and message.
Parse key=value pairs
Implement a parser that converts a space-separated 'key=value' string into a Python dictionary, supporting quoted values.
Replace template variables
Implement a function that replaces {{variable}} placeholders in a string using a dictionary, leaving unknown placeholders intact.
Two Sum
Return indices (i, j) with i < j such that nums[i] + nums[j] == target.
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.
First non-repeating character
Find the index of the first character that appears only once.
Most frequent element
Return the element that appears most often in a list.
Merge dicts summing values
Write a function that merges two dictionaries by summing values for duplicated keys.
Are two lists the same multiset
Write a function that checks if two lists contain the same elements with the same multiplicities, ignoring order.
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.
Missing keys default zero
Write a function to sum numeric values from dictionaries, treating missing keys as zero.
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.
Nested get with dotted path
Implement a function that safely retrieves a value from a deeply nested dictionary using a dot-separated path, returning a default if any key is missing.
Anagram Dictionary Groups Lite
Group a list of words into anagrams using a dictionary keyed by sorted characters.
Common Keys of Two Dictionaries
Implement a function that finds keys shared by two dictionaries and returns them sorted.
Showing 1–24 of 49 challenges · easy
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.