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.
Parse JSON safely
Implement a robust JSON string parser that returns a fallback on invalid input.
Parse Error Recovery
Parse a whitespace-separated string into a list of valid integers, skipping invalid tokens.
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.
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.
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.
Compress Bits Run
Write a function that compresses a binary string by representing consecutive identical bits as a count-bit pair.
Wildcard Match (Simple)
Write a function that checks whether a string matches a pattern with '*' and '?' wildcards.
Longest Substring Without Repeating Characters
Implement a function that returns the length of the longest substring without repeating characters.
Balanced brackets in string
Check if a string of brackets is properly balanced using a stack-based approach.
Format date output
Parse ISO date strings and format them into a friendly US-style date output.
Weekday from date
Write a function that returns the full English weekday name for a date string.
Time Difference HH:MM
Given two times in HH:MM format, return the absolute difference as a string in HH:MM format.
Unix timestamp to datetime
Write a function that returns a UTC datetime string from a Unix timestamp.
Datetime to Unix timestamp
Parse a datetime string and convert it to a Unix timestamp assuming UTC.
Quarter from date
Compute the quarter (1-4) for a date string like '2023-07-15'.
Duration Human Readable
Write a function that turns a number of seconds into a human-readable duration like '2 hours, 1 minute'.
Month Start Date
Parse a date string and return the first day of its month in the same format.
Showing 121–144 of 159 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.