Camel case to snake case
Write a function that converts camelCase input to snake_case while handling acronyms and numbers correctly.
Longest word in a sentence
Write a function that returns the longest word from a sentence, with first-occurrence tie-breaking.
Extract Digits Only
Given a string that may contain letters, symbols, and whitespace, extract all digits in order and return them as an integer.
Longest Word Finder
Write a function that extracts alphabetic words from a string and returns the longest one, with ties broken by earliest position.
Extract digits from string
Write a function that extracts all digit characters from a given string, preserving their original order.
Kebab Case Converter
Implement a function that converts any string to kebab-case, handling spaces, underscores, camelCase, and punctuation.
Expand compressed string
Implement a function that expands run-length encoded strings (e.g., 'a3b2' → 'aaabb').
Roman to Integer
Convert a valid Roman numeral string to an integer using standard rules.
Safe Command Executor
Implement emulate_run that simulates running a command list and returns output and exit code.
Stack Trace Sanitizer
Implement a function that rewrites traceback file paths to basenames only.
Extract Hashtags
Extract unique hashtags from a given text string in the order they appear.
Extract mentions
Extract unique @mentions from a string, respecting email-like patterns and punctuation.
Validate time format
Check whether a given string is a valid 24-hour time in HH:MM format.
Parse Log Line
Write a function that parses a log line and returns a dictionary with timestamp, level, and message.
Remove HTML tags
Remove all HTML tags from a string to extract clean text.
Extract Quoted Strings
Write a function that extracts the text inside every double-quoted substring from a given string.
Split on camelCase
Given a camelCase string, split it into words at uppercase letters and return them as lowercase words.
Extract domain from URL
Extract the domain (hostname without port or www) from a given URL string.
Parse key=value pairs
Implement a parser that converts a space-separated 'key=value' string into a Python dictionary, supporting quoted values.
Find all numbers in text
Write a function that extracts all standalone integers from a text string using regular expressions.
Extract file extensions
Implement a function that extracts the extension from a filename according to standard rules.
Replace template variables
Implement a function that replaces {{variable}} placeholders in a string using a dictionary, leaving unknown placeholders intact.
Nested get with dotted path
Implement a function that safely retrieves a value from a deeply nested dictionary using a dot-separated path, returning a default if any key is missing.
Safe Integer from String
Implement safe_int that converts a string to an integer, returning a default value on any failure, with support for an optional base.
Safe int parser
Implement safe_parse_int that converts a string to an int, returning a default value on failure.
Safe Float Parser
Write a function that safely converts a string to a float, returning None for invalid inputs.
Balanced brackets in string
Check if a string of brackets is properly balanced using a stack-based approach.
Showing 27 challenges · easy
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.