Swap Two Values
Implement a Python function that swaps two given values and returns them in swapped order.
Is divisible by?
Create a function that returns True if a is divisible by b with no remainder, with a clear definition of edge cases.
Volume of Cube
Write a Python function that returns the volume of a cube given its side length.
Enumerate with start
Implement a function that mimics Python's enumerate with a custom start index.
Find all indexes of a substring
Write a function that returns a list of all starting indexes where a substring appears in a string, including overlapping occurrences.
Capitalize First Letter
Write a function that capitalizes the first letter of each word in a string.
Parse key=value pairs
Implement a parser that converts a space-separated 'key=value' string into a Python dictionary, supporting quoted values.
Complex Number Class
Implement a Complex class supporting addition, subtraction, multiplication, division, equality, and string formatting.
Custom iterator class
Implement a custom iterator class that repeatedly yields elements from a list up to a given number of times.
Range-like generator
Implement a custom generator that yields numbers like Python's range but with flexible bounds.
File Line Reader Generator
Implement a generator function that reads a file-like object and yields each non-empty line without loading the whole file into memory.
File Open Context Manager
Create a class that acts as a context manager for opening a virtual file in memory.
Timer Context Manager
Implement a context manager that measures execution time of a with block and stores it.
Multiline anchor match
Extract lines beginning with a plain-text prefix from multiline strings using Python's re module.
Interpolation Search
Implement interpolation search in Python on a sorted list of integers.
Showing 15 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
- 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.