Volume of Cube
Write a Python function that returns the volume of a cube given its side length.
Modulo Remainder
Implement a function that returns the remainder of a divided by b without using the modulo operator.
Print Pyramid Pattern
Implement a function that returns a centered asterisk pyramid as a list of strings.
Last Digit Extractor
Write a function that returns the last digit of a non-negative integer using the modulo operator.
Count word occurrences
Write a function that takes a sentence and returns a dictionary of word counts.
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.
Count Leading Zeros
Write a function that returns the number of leading zeros in a list of integers.
Copy deep vs shallow
Predict and write a function that returns a copied list and inspect whether nested modification affects the original.
Limit and Offset Query
Write a function that returns a page from a dataset given limit and offset.
Array mean and std
Implement the function array_stats that returns the mean and population standard deviation of a list of numbers.
Cumulative Sum Vectorized
Implement a function that returns the cumulative sum of a list of numbers.
Invariant checker
Implement check_invariant(a, b, c) that returns True when a equals b plus c and False otherwise, matching the given examples.
Argmax along axis
Write a function that returns index positions of the maximum values along rows or columns of a 2D list.
Longest word in a sentence
Write a function that returns the longest word from a sentence, with first-occurrence tie-breaking.
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.
Longest Word Finder
Write a function that extracts alphabetic words from a string and returns the longest one, with ties broken by earliest position.
Abbreviate Name
Create a function that takes a full name and returns an abbreviated version with initials and the last name.
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.
Sort characters in string
Write a function that sorts the characters in a string and returns the sorted string.
Safe Command Executor
Implement emulate_run that simulates running a command list and returns output and exit code.
Parse Log Line
Write a function that parses a log line and returns a dictionary with timestamp, level, and message.
Validate username format
Implement a function that validates a username according to length, allowed characters, and no consecutive underscores.
Parse markdown headers
Write a function that parses markdown headers and returns their levels and texts.
Running Maximum
Implement a function that returns a list where each element is the largest value seen so far.
Showing 25–48 of 127 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.