Abbreviate Name
Create a function that takes a full name and returns an abbreviated version with initials and the last name.
Replace Spaces with Dashes
Write a function that replaces every space in a string with a dash.
Compress Consecutive Chars
Write a function that compresses a string by replacing runs of identical characters with the character followed by the count.
Index of First Occurrence
Implement a function that finds the starting index of a substring within a string, returning -1 when absent.
Parse Log Line
Write a function that parses a log line and returns a dictionary with timestamp, level, and message.
Replace multiple spaces
Implement a function that replaces every sequence of spaces with a single space.
Extract domain from URL
Extract the domain (hostname without port or www) from a given URL string.
Basic Calculator III
Implement a recursive descent parser to evaluate a fully parenthesized arithmetic expression with +, -, *, / and parentheses.
Minimum Remove Valid Parentheses
Given a string with parentheses and letters, remove the fewest parentheses to make it valid.
Parse URL components
Write parse_url that splits a URL into its standard components with defaults for missing parts.
Parse key-value lines
Parse structured key-value lines into a dictionary with support for quoted values and escaped characters.
Decode base64 string
Write a function that decodes a base64 string to its original UTF-8 text without using the base64 module.
User Friendly Message
Given a raw user input, format it into a single clean sentence with proper sentence case and trimming.
Two Sum
Return indices (i, j) with i < j such that nums[i] + nums[j] == target.
Maximum subarray (Kadane)
Find the contiguous subarray with the largest sum.
Remove duplicates (sorted)
Return a sorted list with duplicates removed.
Product except self
Return an array where output[i] is the product of all elements except nums[i], without using division.
Find Missing Number 1 to n
Given a list containing n-1 distinct integers from 1 to n, find the missing number without using extra space.
Pad Array Edges
Write a function that pads a list with zeros on both ends.
Sort array by parity
Given a list of integers, return a new list with all evens first and odds last, preserving original relative order.
Linear Interpolation Array
Given an array with some None values, replace them by linear interpolation between the nearest known values.
Pad array edges
Implement a function that pads a list on both ends with a given value to a specified total length.
Are two lists the same multiset
Write a function that checks if two lists contain the same elements with the same multiplicities, ignoring order.
Group names by first letter
Given a list of names, return a dictionary mapping each first letter to all names starting with that letter in original order.
Showing 25–48 of 191 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.