Hexagonal Number
Write a function to check if a positive integer is a hexagonal number.
Count trailing zeros
Write a function that counts the number of trailing zeros in the decimal representation of a positive integer.
Count Leading Zeros
Write a function that returns the number of leading zeros in a list of integers.
Guess Number Game
Simulate a number guessing game with attempts, feedback, and a win/lose result.
Parse environment variables
Write parse_env_vars that parses KEY=VALUE lines into a dict, converting booleans/numbers and ignoring comments.
Array mean and std
Implement the function array_stats that returns the mean and population standard deviation of a list of numbers.
Broadcast Add Scalar
Add a scalar to every number in a 2D list and return a new 2D list without modifying the original.
Cumulative Sum Vectorized
Implement a function that returns the cumulative sum of a list of numbers.
Percentile Calculation
Given a list of numbers and a target value, return the percentile rank of that value in the list.
Count vowels
Count the number of vowels (a, e, i, o, u) in a string (case-insensitive).
Camel case to snake case
Write a function that converts camelCase input to snake_case while handling acronyms and numbers correctly.
Count consonants
Write a function that counts the number of consonant letters in a string.
Rotate String Right
Implement a function that rotates a given string to the right by a specified number of positions, handling shifts larger than the string length.
Find all numbers in text
Write a function that extracts all standalone integers from a text string using regular expressions.
Caesar Cipher Decrypt
Implement a function that decrypts a Caesar cipher by shifting letters back by a given number.
Parse numbered list
Take a string containing a numbered list and return a clean list of the item texts.
Parse range notation
Parse a comma-separated list of ranges and individual numbers, expanding each range into its full sequence.
Additive number sequence
Check whether a given digit string can be partitioned into a valid additive sequence where each term is the sum of the previous two.
Move Zeros to the End
Reorder a list in-place, pushing all zeros to the end while preserving the order of non-zero numbers.
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.
Difference of Consecutive Elements
Given a list of numbers, return a new list where each element is the difference between consecutive elements.
Find Second Largest
Find the second largest unique number in a list, or None if it doesn't exist.
Find Duplicate Number
Given a list of n+1 integers in the range 1..n, find the one integer that appears more than once.
Rearrange Positives and Negatives
Write a function that rearranges a list in-place so all negative numbers come before non-negative numbers.
Showing 25–48 of 184 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.