Practice Arena

Python Coding Challenges

Write real Python in the browser. Instant feedback. From beginner to expert.

467 challenges 330 easy 120 medium 17 hard
Strings & Text medium

Find all anagrams

Return all starting indices where any anagram of a given word appears as a substring.

anagrams strings sliding-window
+20 pts 20m
Lists & Arrays easy

Majority Element Finder

Implement a function that returns the majority element in a list, which appears more than half the time.

majority frequency arrays
+10 pts 15m
Dicts & Sets easy

Word frequency

Return a dict mapping each word to its count in the sentence.

dict counter
+10 pts 10m
Dicts & Sets easy

Mode of a list via counting

Implement a function that returns the mode of a list, resolving ties by the element that appears first.

counting dictionaries mode
+10 pts 15m
Dicts & Sets easy

Top k keys by count

Given a dictionary mapping keys to counts, return the top k keys with the highest counts, breaking ties alphabetically.

dictionary sorting frequency
+10 pts 15m
Dicts & Sets easy

Top K Frequent Words

Given a list of words, return the k most frequent words sorted by frequency (descending) and then alphabetically.

dictionary sorting frequency
+10 pts 15m
Dicts & Sets easy

Sort by frequency

Sort a list by element frequency descending, with ties broken by order of first occurrence.

sorting frequency dictionaries
+10 pts 15m
Dicts & Sets easy

Frequency sort descending

Write a function that sorts a list by frequency descending while preserving original order for ties.

frequency sorting dict
+10 pts 15m
Heaps & Priority Queues medium

Top K Frequent Elements

Given an integer array and a number k, return the k most frequent elements using a heap-based approach.

heap frequency counting
+25 pts 25m

Showing 9 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

  1. Pick a category — basics, algorithms, strings, and more
  2. Open a challenge, read the statement, and edit the starter code
  3. 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.