Absolute Difference of Two Integers
Compute the absolute difference between two integers, regardless of order.
Swap Two Values
Implement a Python function that swaps two given values and returns them in swapped order.
Fancy Index Select
Given a 2D matrix and a list of row indices, select those rows in order and return them as a new 2D list.
Order by Name
Implement a function that sorts a list of names alphabetically ignoring case, returning a new list.
Reverse a string
Return the characters of the string in reverse order.
Zigzag string conversion
Encode a string in zigzag order across numRows rows, then read row by row.
Extract Digits Only
Given a string that may contain letters, symbols, and whitespace, extract all digits in order and return them as an integer.
Reverse Words in a Sentence
Reverse the order of words in a sentence while preserving single spaces between words.
Extract digits from string
Write a function that extracts all digit characters from a given string, preserving their original order.
Extract Hashtags
Extract unique hashtags from a given text string in the order they appear.
Remove Duplicate Letters
Implement a function that removes duplicate characters from a string while preserving the order of their first occurrence.
Custom Sort String
Given a string s and an order string, reorder s so that characters that appear in order come first in that order, and all other characters are appended in stable original order.
Move Zeros to the End
Reorder a list in-place, pushing all zeros to the end while preserving the order of non-zero numbers.
Interleave Two Lists
Write a function that interleaves two lists element by element, preserving order.
All Unique Values Keep Order
Remove duplicates from a list, keeping only the first occurrence of each value while preserving relative order.
Move Zeros to End
Rearrange a list by moving all zeros to the end while preserving the relative order of non-zero elements.
Difference of Two Lists
Write a function that returns items in list a that are not in list b, preserving order and duplicates.
Wave sort array
Given a list of integers, reorder it into a wave pattern where elements alternate down-up, and return the new list.
Move Zeroes
Implement move_zeroes(nums) that in-place moves all zeros to the end while maintaining the order of non-zero elements.
Sort array by parity
Given a list of integers, return a new list with all evens first and odds last, preserving original relative order.
Reorder list halves
Implement reorder_list(nums) that returns the first half followed by the reversed second half.
Convert Binary Number List
Given a list of bits (0s and 1s) in most-significant-first order, return the equivalent integer value.
One Hot Encode Labels
Given a list of categorical labels, return a list of one-hot encoded vectors based on the sort order of unique labels.
Are two lists the same multiset
Write a function that checks if two lists contain the same elements with the same multiplicities, ignoring order.
Showing 1–24 of 78 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.