Practice Arena

Python Coding Challenges

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

925 challenges 556 easy 323 medium 46 hard
Strings & Text easy

Extract Quoted Strings

Write a function that extracts the text inside every double-quoted substring from a given string.

strings parsing quotes
+8 pts 12m
Strings & Text easy

Split on camelCase

Given a camelCase string, split it into words at uppercase letters and return them as lowercase words.

strings parsing camelcase
+8 pts 10m
Strings & Text easy

Extract domain from URL

Extract the domain (hostname without port or www) from a given URL string.

url parsing strings
+8 pts 12m
Strings & Text easy

Normalize Whitespace

Write a function that normalizes any whitespace in a string to single spaces and trims the ends.

strings whitespace split-join
+5 pts 10m
Strings & Text easy

Strip Leading Zeros

Write a function that strips leading zeros from a string representing a non-negative integer.

strings strip lstrip
+5 pts 5m
Strings & Text easy

Parse key=value pairs

Implement a parser that converts a space-separated 'key=value' string into a Python dictionary, supporting quoted values.

parsing strings dictionaries
+8 pts 10m
Strings & Text easy

Extract file extensions

Implement a function that extracts the extension from a filename according to standard rules.

strings parsing file-paths
+8 pts 10m
Strings & Text easy

Validate username format

Implement a function that validates a username according to length, allowed characters, and no consecutive underscores.

strings validation returns
+8 pts 12m
Strings & Text easy

Hamming Distance

Implement a function that computes the Hamming distance between two strings of equal length.

strings character-comparison distance
+10 pts 15m
Strings & Text easy

Hex encode decode

Write hex_encode and hex_decode to convert between hex strings and integer byte values.

hex encoding strings
+8 pts 12m
Strings & Text easy

ROT13 Transform

Implement ROT13, a letter substitution cipher that rotates the alphabet by 13 positions.

strings cipher transformation
+10 pts 15m
Strings & Text easy

Caesar Cipher Decrypt

Implement a function that decrypts a Caesar cipher by shifting letters back by a given number.

strings ascii cipher
+10 pts 15m
Strings & Text medium

Simplify Path

Implement a function that simplifies a Unix-style absolute file path to its canonical form.

strings stack parsing
+20 pts 25m
Strings & Text medium

Minimum Remove Valid Parentheses

Given a string with parentheses and letters, remove the fewest parentheses to make it valid.

strings stack validation
+20 pts 25m
Strings & Text easy

Remove Duplicate Letters

Implement a function that removes duplicate characters from a string while preserving the order of their first occurrence.

strings deduplication order-preserving
+10 pts 15m
Strings & Text medium

Custom Sort String

Given a string s and an order string, reorder s so that characters that appear in order come first in that order, and all other characters are appended in stable original order.

sorting strings custom-order
+15 pts 20m
Strings & Text easy

Parse URL components

Write parse_url that splits a URL into its standard components with defaults for missing parts.

url-parsing strings parsing
+8 pts 10m
Strings & Text easy

Parse HTTP Status Line

Write a function that parses a well-formed HTTP status line into its three components.

strings parsing http
+8 pts 15m
Strings & Text medium

Parse key-value lines

Parse structured key-value lines into a dictionary with support for quoted values and escaped characters.

parsing strings dictionary
+20 pts 20m
Strings & Text easy

Parse markdown headers

Write a function that parses markdown headers and returns their levels and texts.

markdown parsing strings
+10 pts 15m
Strings & Text easy

Parse bullet list

Parse a markdown-style bullet list and return the list of item texts, stripping bullet markers and trimming surrounding whitespace.

parsing strings markdown
+8 pts 10m
Strings & Text easy

Decode base64 string

Write a function that decodes a base64 string to its original UTF-8 text without using the base64 module.

base64 decode strings
+8 pts 10m
Strings & Text easy

Parse Version SemVer

Write a function that parses a semantic version string into its numeric components.

strings parsing semver
+10 pts 15m
Strings & Text easy

Compare Version Strings

Given two version strings, compare them numerically by splitting on dots and ignoring leading zeros.

strings parsing comparison
+10 pts 15m

Showing 73–96 of 162 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.