Suppress Specific Exceptions
Implement a custom context manager that suppresses specified exception types within its block.
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.
Nth Triangular Number
Implement a function that returns the nth triangular number efficiently.
Clamp and round to nearest ten
Clamp a number between given bounds and round the result to the nearest ten with halves away from zero.
Integer Square Root Floor
Implement a function that returns the greatest integer whose square is ≤ n, using only integer operations.
Power set size
Compute the size of the power set of a given sequence.
Polynomial evaluator
Implement a polynomial evaluator that computes the value of a polynomial given as a list of coefficients.
Catalan number
Implement a function that returns the nth Catalan number using dynamic programming.
Stirling number
Implement a function to compute Stirling numbers of the second kind S(n,k).
Euler Totient Function
Implement Euler's totient function φ(n) for positive integers.
Sieve of Eratosthenes
Implement the Sieve of Eratosthenes to return a sorted list of all primes up to a given integer n.
Prime Factorization
Return a sorted list of prime factors of a positive integer, including repeated factors.
Count divisors
Compute the number of positive divisors of a given integer using its prime factorization.
Showing 481–504 of 925 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.