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

Run-length encoding

Compress consecutive identical characters, e.g. 'aaabbc' → 'a3b2c1'.

strings compression
+20 pts 20m
Strings & Text medium

Longest common prefix

Find the longest common prefix among a list of strings.

strings zip
+18 pts 18m
Strings & Text medium

Integer to Roman

Convert a positive integer to its Roman numeral representation.

strings greedy
+22 pts 22m
Strings & Text medium

Zigzag string conversion

Encode a string in zigzag order across numRows rows, then read row by row.

strings math
+22 pts 20m
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
Strings & Text medium

Substring Anagrams

Return all start indices in a string where a substring of length k is an anagram of a pattern string.

strings sliding-window hash-map
+20 pts 25m
Strings & Text medium

Longest Palindrome Substring

Given a string s, return the longest substring that reads the same forwards and backwards.

strings palindrome substring
+20 pts 25m
Dicts & Sets medium

Group anagrams

Group words that are anagrams of each other.

dict sorting strings
+22 pts 20m
Data Structures & Algorithms medium

Decode Ways

Count the number of ways to decode a numeric string into letters using the mapping A=1 to Z=26.

dynamic programming strings counting
+20 pts 25m
Regular Expressions medium

Validate Email Regex

Implement a function that validates email addresses using regex with specific rules.

regex email validation
+20 pts 25m
Dynamic Programming medium

Levenshtein Distance

Implement the classic Levenshtein distance algorithm to measure string similarity.

strings dynamic-programming edit-distance
+30 pts 30m
Dynamic Programming medium

Longest Common Subsequence

Given two strings, compute the length of the longest subsequence common to both.

dynamic-programming strings lcs
+30 pts 30m
Dynamic Programming medium

Longest Palindromic Subsequence

Compute the length of the longest palindromic subsequence in a given string.

strings dp subsequence
+25 pts 30m
Dynamic Programming medium

Edit Distance (Levenshtein Distance)

Implement the classic edit distance algorithm to find the minimum number of single-character edits required to transform one string into another.

dynamic-programming strings levenshtein-distance
+25 pts 30m
Dynamic Programming medium

Word Break DP

Implement a function to check if a string can be segmented into space-separated dictionary words.

dynamic-programming strings word-break
+20 pts 25m
Two Pointers & Sliding Window medium

Character Replacement Window

Given a string and a number k, find the length of the longest substring that can be made uniform by replacing at most k characters.

sliding-window two-pointers strings
+30 pts 25m
Data Formats & Parsing medium

Extract JSON-like numbers

Parse a simplified JSON-like string without using the json module and sum all numbers found in it.

json parsing numbers
+14 pts 20m

Showing 17 challenges · medium

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.