FizzBuzz, precisely
Return a newline-separated string for 1..n: Fizz, Buzz, FizzBuzz, or the number.
Hello, name!
Implement a function that returns a personalized greeting for a given name.
Minutes to Hours: Time Conversion Helper
Write a function that converts minutes into a human-readable 'Xh Ym' string, with special cases for zero and whole hours.
Countdown printer
Implement a function that prints a countdown from a given number down to 1, then returns 'Go!'.
Print Pyramid Pattern
Implement a function that returns a centered asterisk pyramid as a list of strings.
Count word occurrences
Write a function that takes a sentence and returns a dictionary of word counts.
Pathlib Operations: File Path Basics
Practice using pathlib to manipulate file paths and extract components.
Validate date format
Return True if input string is exactly YYYY-MM-DD and a real calendar date.
Palindromic Number Check
Write a function to check if a given integer is a palindrome.
Reverse a string
Return the characters of the string in reverse order.
Palindrome check
Return True if the string reads the same forwards and backwards (ignoring case and non-alphanumeric).
Count vowels
Count the number of vowels (a, e, i, o, u) in a string (case-insensitive).
Title case converter
Return the string with each word capitalised.
Anagram check
Return True if two strings are anagrams of each other.
Strip and Collapse Whitespace
Write a function that strips leading/trailing whitespace and collapses inner runs of whitespace to single spaces.
Snake case to camel case
Implement a function that converts snake_case strings to camelCase.
Camel case to snake case
Write a function that converts camelCase input to snake_case while handling acronyms and numbers correctly.
Remove punctuation
Write a function that removes all ASCII punctuation characters from a string.
Is pangram
Write a function that determines whether a given string is a pangram, ignoring case and non-letter characters.
Caesar Cipher Shift
Implement a function to apply a Caesar cipher shift to a string, preserving case and ignoring non-letters.
Repeat each character n times
Given a string s and an integer n, return a new string where each character of s is repeated n times consecutively.
Longest word in a sentence
Write a function that returns the longest word from a sentence, with first-occurrence tie-breaking.
Replace vowels with stars
Write a function that replaces every vowel in a given string with an asterisk.
Is isogram
Implement a function that determines whether a string is an isogram (no repeated letters, case-insensitive).
Extract Digits Only
Given a string that may contain letters, symbols, and whitespace, extract all digits in order and return them as an integer.
Kebab Case a Phrase
Implement a function that converts a phrase into lowercase kebab-case, handling spaces, punctuation, and camelCase.
Normalize quotes
Replace all typographic quote characters with straight ASCII quotes.
Remove Consecutive Duplicate Letters
Implement a function that removes consecutive duplicate letters from a string, keeping only one occurrence of each run.
Interleave Two Strings
Given two strings s1 and s2, return a new string that interleaves them character by character, starting with s1.
Is rotation of another string
Write a function to determine if one string is a rotation of another string.
Initials from a Full Name
Return the uppercase initials of each word in a given full name.
Count words in a sentence
Implement a function to count words in a sentence, ignoring extra whitespace and handling empty strings.
Center a string in a width
Write a function that centers a string within a specified width by adding spaces on both sides.
Reverse Words in a Sentence
Reverse the order of words in a sentence while preserving single spaces between words.
Count consonants
Write a function that counts the number of consonant letters in a string.
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.
Remove Duplicates from String
Given a string, return a new string with each character that repeats consecutively reduced to a single occurrence.
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.
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.
Extract digits from string
Write a function that extracts all digit characters from a given string, preserving their original order.
Replace Spaces with Dashes
Write a function that replaces every space in a string with a dash.
Snake case converter
Implement a function that converts a string to snake_case according to given rules.
Camel Case Converter
Write a function that converts a space-separated phrase into lower camelCase.
Kebab Case Converter
Implement a function that converts any string to kebab-case, handling spaces, underscores, camelCase, and punctuation.
Count Syllables (Simple)
Count syllables in a word by counting groups of consecutive vowels (a, e, i, o, u).
Is isogram?
Write a function that checks whether a given word is an isogram, ignoring letter case and only considering alphabetic characters.
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.
Expand compressed string
Implement a function that expands run-length encoded strings (e.g., 'a3b2' → 'aaabb').
Count Substrings
Implement a function that counts non-overlapping occurrences of a substring in a given string.
Most Common Character
Return the character that appears most frequently in a string, breaking ties by earliest occurrence.
Isomorphic Strings Check
Given two strings, check if they are isomorphic by verifying a one-to-one character mapping.
Index of First Occurrence
Implement a function that finds the starting index of a substring within a string, returning -1 when absent.
Error message formatter
Write a function that constructs a formatted error message from a code, an optional context, and a fallback message.
Stack Trace Sanitizer
Implement a function that rewrites traceback file paths to basenames only.
Extract Hashtags
Extract unique hashtags from a given text string in the order they appear.
Extract mentions
Extract unique @mentions from a string, respecting email-like patterns and punctuation.
Validate time format
Check whether a given string is a valid 24-hour time in HH:MM format.
Replace multiple spaces
Implement a function that replaces every sequence of spaces with a single space.
Extract Quoted Strings
Write a function that extracts the text inside every double-quoted substring from a given string.
Split on camelCase
Given a camelCase string, split it into words at uppercase letters and return them as lowercase words.
Extract domain from URL
Extract the domain (hostname without port or www) from a given URL string.
Normalize Whitespace
Write a function that normalizes any whitespace in a string to single spaces and trims the ends.
Strip Leading Zeros
Write a function that strips leading zeros from a string representing a non-negative integer.
Parse key=value pairs
Implement a parser that converts a space-separated 'key=value' string into a Python dictionary, supporting quoted values.
Extract file extensions
Implement a function that extracts the extension from a filename according to standard rules.
Validate username format
Implement a function that validates a username according to length, allowed characters, and no consecutive underscores.
Hamming Distance
Implement a function that computes the Hamming distance between two strings of equal length.
First non-repeating character
Find the index of the first character that appears only once.
Group names by first letter
Given a list of names, return a dictionary mapping each first letter to all names starting with that letter in original order.
Keys Sorted by Value Descending
Given a dictionary mapping strings to integers, return a list of keys sorted by value descending, and when values tie, alphabetically ascending.
Anagram Dictionary Groups Lite
Group a list of words into anagrams using a dictionary keyed by sorted characters.
Anagram Groups by Size
Group a list of words into anagram groups and return them sorted by group size and lexicographically.
Top K Frequent Words
Given a list of words, return the k most frequent words sorted by frequency (descending) and then alphabetically.
Ransom Note Builder
Given two strings, determine if the ransom note can be formed from the words in the magazine.
Valid parentheses
Return True if brackets in the string close in the correct order.
Validate Hex Color Code
Write a function that validates hex color codes using regular expressions.
Multiline anchor match
Extract lines beginning with a plain-text prefix from multiline strings using Python's re module.
Compress Bits Run
Write a function that compresses a binary string by representing consecutive identical bits as a count-bit pair.
Longest Substring Without Repeating Characters
Implement a function that returns the length of the longest substring without repeating characters.
Showing 80 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.