Practice Arena

Python Coding Challenges

Write real Python in the browser. Instant feedback. From beginner to expert.

467 challenges 330 easy 120 medium 17 hard
Python Basics easy

Min of three numbers

Write a function that returns the minimum of three integers.

min comparison function
+5 pts 5m
Python Basics easy

Seconds to Hours Minutes Seconds

Convert total seconds into a zero-padded HH:MM:SS format.

arithmetic divmod formatting
+8 pts 10m
Python Basics easy

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.

arithmetic formatting conditionals
+8 pts 10m
Python Basics easy

Find Minimum Value

Write a function that returns the minimum integer from a given list.

min list loop
+10 pts 10m
Python Basics easy

Range of values

Calculate the range (max minus min) of a list of numbers. Empty list returns 0.

min max numbers
+10 pts 10m
Strings & Text easy

Is pangram

Write a function that determines whether a given string is a pangram, ignoring case and non-letter characters.

strings sets algorithm
+8 pts 12m
Strings & Text easy

Is isogram

Implement a function that determines whether a string is an isogram (no repeated letters, case-insensitive).

strings case-insensitive validation
+10 pts 10m
Strings & Text easy

Is rotation of another string

Write a function to determine if one string is a rotation of another string.

strings rotation membership
+10 pts 15m
Strings & Text easy

Hamming Distance

Implement a function that computes the Hamming distance between two strings of equal length.

strings character-comparison distance
+10 pts 15m
Lists & Arrays easy

Average excluding min and max

Return the average of a list after discarding the lowest and highest elements, handling edge cases.

lists statistics sorting
+7 pts 10m
Dicts & Sets easy

Merge dicts summing values

Write a function that merges two dictionaries by summing values for duplicated keys.

dicts merge sum
+10 pts 10m
Dicts & Sets easy

Count Pairs with Sum

Implement a function that counts the number of distinct pairs in a list summing to a target.

dictionary pair-counting hash-map
+10 pts 15m
Dicts & Sets easy

Ransom Note Builder

Given two strings, determine if the ransom note can be formed from the words in the magazine.

dictionary counting strings
+10 pts 15m
Decorators & Context Managers easy

Timing Decorator

Implement a decorator that prints the execution time of a function.

decorators time performance
+10 pts 15m
Decorators & Context Managers easy

Context Manager Class

Implement a context manager class that measures execution time and sets duration, with None if an exception occurred.

context-manager classes timing
+8 pts 12m
Decorators & Context Managers easy

Timer Context Manager

Implement a context manager that measures execution time of a with block and stores it.

context-manager timing measurement
+10 pts 15m
Decorators & Context Managers easy

Context Decorator Dual

Implement a timing decorator and a context manager that both record elapsed time in seconds.

decorator context-manager time
+10 pts 15m
Regular Expressions easy

Validate phone number

Write a function that uses regular expressions to determine if a given string is a valid US phone number.

regex validation phone
+10 pts 15m
Math & Number Theory easy

Catalan number

Implement a function that returns the nth Catalan number using dynamic programming.

math dynamic-programming combinatorics
+10 pts 15m
Math & Number Theory easy

Stirling number

Implement a function to compute Stirling numbers of the second kind S(n,k).

stirling-numbers dynamic-programming combinatorics
+10 pts 15m
Math & Number Theory easy

Lucas Sequence

Implement a function to compute the n-th Lucas number using iteration or recursion with memoization.

math sequence dynamic programming
+10 pts 15m
Bit Manipulation easy

Add without plus

Implement a function that adds two integers using only bitwise operations, no arithmetic plus or minus.

bitwise addition xor
+10 pts 15m
Dynamic Programming easy

Min cost climbing stairs

Compute the minimum total cost to reach the top of a staircase, given you can climb 1 or 2 steps at a time.

dynamic programming memoization array
+10 pts 15m
Dynamic Programming easy

House Robber

Given a list of house values, return the maximum sum you can rob without robbing two adjacent houses.

dynamic-programming arrays optimization
+10 pts 15m
Dynamic Programming easy

Unique Paths in a Grid

Count the number of unique paths from the top-left corner to the bottom-right corner of a grid, moving only right and down.

dynamic-programming grid counting
+15 pts 20m
Dynamic Programming easy

Triangle Minimum Path

Compute the minimum path sum from top to bottom of a triangle given as a list of lists.

dynamic-programming bottom-up arrays
+12 pts 20m
Trees & Binary Trees easy

Minimum Depth of Tree

Given a binary tree, compute the minimum depth from the root to the nearest leaf node.

binary-tree depth traversal
+10 pts 15m
Two Pointers & Sliding Window easy

Best Time to Buy and Sell Stock

Given a list of daily stock prices, determine the maximum profit achievable by buying on one day and selling on a later day.

arrays sliding-window profit
+10 pts 15m
Heaps & Priority Queues easy

Min Heap Class

Build a MinHeap class with push, pop, peek, and size methods that maintain a valid min-heap.

heap priority-queue class
+10 pts 15m
Matrix & 2D Arrays easy

Valid Sudoku Board

Determine if a 9x9 Sudoku board is valid by checking rows, columns, and 3x3 sub-boxes.

matrix set validation
+10 pts 15m

Showing 30 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

  1. Pick a category — basics, algorithms, strings, and more
  2. Open a challenge, read the statement, and edit the starter code
  3. 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.