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

Even or odd?

Return 'even' or 'odd' for an integer.

modulo conditionals
1
+5 pts 5m
Python Basics easy

Clamp a Number to a Range

Implement a clamp function that returns a value within a specified range.

numbers conditionals comparisons
+5 pts 5m
Python Basics easy

Leap Year Checker

Implement a function that decides whether a year is a leap year according to the standard Gregorian rules.

boolean conditionals date
+5 pts 5m
Python Basics easy

Grade from Score

Write a function that maps a numeric score to its letter grade using standard grading thresholds.

conditionals functions integers
+8 pts 10m
Python Basics easy

Sign of a Number

Write a function that returns the sign of a number as a string.

conditionals numbers comparison
+5 pts 5m
Python Basics easy

Max of a variable-length list

Implement a function that returns the maximum value from a list of numbers without using max().

conditionals loops comparison
+10 pts 10m
Python Basics easy

Classify triangle by sides

Write a function that classifies a triangle based on three side lengths.

conditionals geometry validation
+8 pts 10m
Python Basics easy

Between inclusive

Write a function that returns True if a number is between two given bounds, inclusive of the bounds.

comparison conditionals boundaries
+8 pts 10m
Python Basics easy

Replace negatives with zero

Implement a function that replaces all negative numbers in a list with zero.

lists loops conditionals
+10 pts 10m
Python Basics easy

Leap Year Checker

Implement a function that returns True if a year is a leap year according to the Gregorian calendar rules.

conditionals boolean modulo
+10 pts 10m
Python Basics easy

Grade Calculator

Implement a function that converts a numeric score to a letter grade using a standard scale.

conditionals functions basic-syntax
+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

Max of three numbers

Implement a function that returns the maximum of three numbers using comparisons.

conditionals comparison numbers
+10 pts 10m
Python Basics easy

Sign of a number

Write a function sign_of_number that returns -1 for negatives, 0 for zero, and 1 for positives.

conditionals numbers comparison
+5 pts 5m
Python Basics easy

Countdown printer

Implement a function that prints a countdown from a given number down to 1, then returns 'Go!'.

loops conditionals function-definition
+5 pts 5m
Python Basics easy

Count Positives

Count the positive numbers in a list of integers.

conditionals loops basic
+10 pts 10m
Python Basics easy

Is divisible by?

Create a function that returns True if a is divisible by b with no remainder, with a clear definition of edge cases.

division modulo conditionals
+10 pts 10m
Python Basics easy

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.

linear-search list index
+10 pts 15m
Python Basics easy

Validate date format

Return True if input string is exactly YYYY-MM-DD and a real calendar date.

validation strings dates
+10 pts 10m
Python Basics easy

Palindromic Number Check

Write a function to check if a given integer is a palindrome.

numbers strings conditionals
+10 pts 10m
Python Basics easy

Hexagonal Number

Write a function to check if a positive integer is a hexagonal number.

math loops conditionals
+10 pts 15m
Math & Number Theory easy

Clamp and round to nearest ten

Clamp a number between given bounds and round the result to the nearest ten with halves away from zero.

clamping rounding math
+10 pts 12m
Math & Number Theory easy

Perfect Number Check

Write a function that returns True if a number is perfect, i.e., equal to the sum of its proper divisors.

math divisors number-theory
+10 pts 15m
Bit Manipulation easy

Sparse Number Check

Check if a non-negative integer is sparse, meaning its binary representation contains no adjacent 1 bits.

bitwise binary conditionals
+10 pts 15m

Showing 24 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.