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.
Count Leading Zeros
Write a function that returns the number of leading zeros in a list of integers.
Count vowels
Count the number of vowels (a, e, i, o, u) in a string (case-insensitive).
Count words in a sentence
Implement a function to count words in a sentence, ignoring extra whitespace and handling empty strings.
Count consonants
Write a function that counts the number of consonant letters in a string.
Count Syllables (Simple)
Count syllables in a word by counting groups of consecutive vowels (a, e, i, o, u).
Count Substrings
Implement a function that counts non-overlapping occurrences of a substring in a given string.
Most Common Character
Return the character that appears most frequently in a string, breaking ties by earliest occurrence.
Majority Element Finder
Implement a function that returns the majority element in a list, which appears more than half the time.
Difference of Two Lists
Write a function that returns items in list a that are not in list b, preserving order and duplicates.
Counting Sort
Implement the counting sort algorithm to sort a list of non-negative integers in O(n + k) time.
Count Adjacent Pairs
Given a list of integers and a target, count adjacent pairs whose sum equals the target.
Intersection two lists length
Return the number of distinct elements that appear in both input lists.
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.
Mode of a list via counting
Implement a function that returns the mode of a list, resolving ties by the element that appears first.
Values that appear once
Return a list of numbers that appear exactly once in the input list, in original order.
Pair with difference K
Count unordered index pairs with absolute difference exactly K, handling duplicates correctly.
Set intersection size
Count how many distinct values appear in both of two given lists.
Count Pairs with Sum
Implement a function that counts the number of distinct pairs in a list summing to a target.
Ransom Note Builder
Given two strings, determine if the ransom note can be formed from the words in the magazine.
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.
Count pairs with given difference
Count how many unordered pairs in a list have a given absolute difference using an efficient approach.
Showing 1–24 of 34 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.