Last Occurrence of a Value
Implement a function that returns the last index of a given value in a list, or -1 if it's not present.
Cycle a List Once
Implement a function that rotates a list right by one position.
Linear Search Implementation
Implement a linear search function that returns the index of the first occurrence of a target in a list, or -1 if not found.
Enumerate with start
Implement a function that mimics Python's enumerate with a custom start index.
Find all indexes of a substring
Write a function that returns a list of all starting indexes where a substring appears in a string, including overlapping occurrences.
Interleave Two Strings
Given two strings s1 and s2, return a new string that interleaves them character by character, starting with s1.
Find substring index
Implement a function that returns the starting index of the first occurrence of a substring using only basic string indexing and slicing.
Index of First Occurrence
Implement a function that finds the starting index of a substring within a string, returning -1 when absent.
Running Product of Integers
Given a list of integers, return a new list where each element at index i is the product of all elements from index 0 to i.
Rotate Left by k
Implement a function that rotates a list left by k positions.
Interleave Two Lists
Write a function that interleaves two lists element by element, preserving order.
Keep only even indexes
Given a list, return a new list containing only the elements at even indices (0, 2, 4, ...).
Partition around a pivot value
Implement an in-place partition of a list around a given pivot value, returning the boundary index.
Zip lists into pairs
Write a function that takes two lists and returns a list of two-element sublists pairing elements by index up to the shortest length.
Middle Element of an Odd-Length List
Implement a function that returns the middle element of an odd-length list.
Zip Two Lists
Write a function that pairs elements from two lists by index, stopping at the shorter list.
Last occurrence index
Implement a function that returns the last index of a given value in a list, or -1 if the value is not present.
First non-repeating character
Find the index of the first character that appears only once.
Word to Index Map
Create a function that returns a dictionary mapping each unique word to the index of its first occurrence.
Pair with difference K
Count unordered index pairs with absolute difference exactly K, handling duplicates correctly.
Binary search
Return the index of target in a sorted list, or -1 if not present.
Index of peak element
Implement a function that returns the index of any peak element in a given integer array.
Find Peak Element
Implement a function that returns the index of any peak element in an integer array.
Previous Smaller Element
Find the nearest previous index with a smaller value for every element in an array.
Exponential Search
Implement exponential search to find any valid index of a target in a sorted list.
Find Rightmost Set Bit
Implement a function that returns the 1-indexed position of the rightmost set bit of a positive integer, or 0 if none.
Set kth Bit
Implement a function that sets the kth bit (0-indexed) of a non-negative integer to 1 and returns the result.
Showing 27 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.