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

Snake case to camel case

Implement a function that converts snake_case strings to camelCase.

strings case-conversion text-processing
+10 pts 10m
Strings & Text easy

Error message formatter

Write a function that constructs a formatted error message from a code, an optional context, and a fallback message.

formatting strings function
+10 pts 15m
Strings & Text easy

Extract Hashtags

Extract unique hashtags from a given text string in the order they appear.

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

Remove HTML tags

Remove all HTML tags from a string to extract clean text.

html string parsing
+10 pts 15m
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

Find all numbers in text

Write a function that extracts all standalone integers from a text string using regular expressions.

regex parsing numbers
+8 pts 12m
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

Parse numbered list

Take a string containing a numbered list and return a clean list of the item texts.

string parsing strip split
+8 pts 12m
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

Find repeated words

Return a lowercase list of unique words that appear more than once across a given text, ignoring case.

string parsing word-count
+8 pts 12m
Advanced Python medium

Context manager timer

Implement a Timer context manager that records elapsed seconds.

context-manager time
1
+22 pts 20m
Advanced Python easy

Async Context Manager Lifecycle

Build an async context manager class that tracks acquisition and ensures cleanup.

async context-manager magic-methods
+10 pts 15m
Advanced Python medium

Context Variable Scope

Implement a context manager that temporarily changes a global variable and restores it afterwards, even if an exception occurs.

context-manager global-scope scope
+20 pts 20m
Iterators & Generators easy

Close generator early

Wrap any iterable in a generator that tracks yielded items and supports close() correctly.

generators context-manager close-method
+8 pts 10m
Decorators & Context Managers easy

Context Manager Class

Implement a context manager class that measures execution time and sets duration, with None if an exception occurred.

context-manager classes timing
+8 pts 12m
Decorators & Context Managers easy

File Open Context Manager

Create a class that acts as a context manager for opening a virtual file in memory.

context-manager file-io python
+10 pts 15m
Decorators & Context Managers medium

Temporary directory manager

Implement a context manager that creates a temporary directory and automatically removes it even on errors.

context-manager tempdir file-io
+20 pts 20m
Decorators & Context Managers easy

Timer Context Manager

Implement a context manager that measures execution time of a with block and stores it.

context-manager timing measurement
+10 pts 15m
Decorators & Context Managers easy

Suppress stderr manager

Implement a context manager that suppresses all output written to stderr during its block.

context-managers stderr redirect
+8 pts 10m
Decorators & Context Managers easy

Context Decorator Dual

Implement a timing decorator and a context manager that both record elapsed time in seconds.

decorator context-manager time
+10 pts 15m
Decorators & Context Managers medium

Context manager from generator

Implement a context manager that yields a value and ensures cleanup, using a generator-based approach.

context-manager generator contextlib
+20 pts 20m
Decorators & Context Managers easy

Lock Context Manager

Implement a Lock class with acquire/release and context manager support.

context-manager threading lock
+8 pts 12m
Error Handling & Exceptions medium

Resource Cleanup Manager

Implement a context manager that tracks and releases resources reliably, and can report cleanup actions.

context-managers exceptions cleanup
+20 pts 20m

Showing 1–24 of 29 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.