Kebab Case a Phrase
Implement a function that converts a phrase into lowercase kebab-case, handling spaces, punctuation, and camelCase.
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.
Remove HTML tags
Remove all HTML tags from a string to extract clean text.
Find all numbers in text
Write a function that extracts all standalone integers from a text string using regular expressions.
Validate Email Regex
Implement a function that validates email addresses using regex with specific rules.
Validate phone number
Write a function that uses regular expressions to determine if a given string is a valid US phone number.
Match IPv4 Address
Write a function that uses a regular expression to check if a string is a valid IPv4 address.
Match IPv6 Address
Write a function that uses a regex to validate whether a string is a fully expanded IPv6 address.
Match Credit Card Pattern
Write a function that validates a credit card number string against a set of formatting rules.
Validate Hex Color Code
Write a function that validates hex color codes using regular expressions.
Multiline anchor match
Extract lines beginning with a plain-text prefix from multiline strings using Python's re module.
Lookahead Validation
Write a regex-based function to check if a password meets length and character class requirements.
Match Balanced Parentheses with Regex
Write a function that uses regular expressions to determine if parentheses are balanced and properly nested.
Match scientific notation
Implement a function that checks if a string is in valid scientific notation.
Non-greedy quantifier
Implement a function that uses a non-greedy regex to extract the shortest substring between two delimiters.
Named group extraction
Parse a log line into structured fields using named groups and re.match.
Parse Apache log line
Write a function that parses a single Apache access log line into a dictionary with IP, timestamp, request, status, and size.
Showing 1–19 of 19 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.