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.
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.
Broadcast Add Scalar
Add a scalar to every number in a 2D list and return a new 2D list without modifying the original.
Replace vowels with stars
Write a function that replaces every vowel in a given string with an asterisk.
Is pangram?
Implement is_pangram(s) to return True if the string contains every letter from 'a' to 'z' at least once, ignoring case and non-alphabetic characters.
Abbreviate Name
Create a function that takes a full name and returns an abbreviated version with initials and the last name.
Mask email address
Given an email address, return a masked version that hides everything but the first and last character of the local part and the domain.
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.
Sort array by parity
Given a list of integers, return a new list with all evens first and odds last, preserving original relative order.
Digit Expansion Generator
Create a generator that lazily yields each decimal digit of a non-negative integer from most significant to least significant.
Toggle kth Bit
Implement a function that toggles the kth bit of a non-negative integer (0-indexed from the least significant bit) and returns the new integer.
Find Indices of Target in Sorted List
Given a sorted list and a target, return the indices of its first and last occurrence, or [-1, -1] if absent.
Last Stone Weight
Given an array of stone weights, repeatedly smash the two heaviest stones and return the last remaining weight or 0.
Showing 14 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.