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

GCD via Euclid

Compute the greatest common divisor of two positive integers.

math recursion
+10 pts 10m
Python Basics easy

Absolute Difference of Two Integers

Compute the absolute difference between two integers, regardless of order.

absolute difference math
+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

Min of three numbers

Write a function that returns the minimum of three integers.

min comparison function
+5 pts 5m
Python Basics easy

Integer division and remainder

Write a function that performs integer division and returns both quotient and remainder.

operators division remainder
+8 pts 10m
Python Basics easy

Sum numbers from 1 to n

Implement a function that computes the sum of all integers from 1 to n.

sum loop arithmetic
+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

Digit count of an integer

Given an integer, return the number of digits it has, handling negatives and zero correctly.

integers loops arithmetic
+5 pts 5m
Python Basics easy

Count Multiples in a Range

Given a start, end, and divisor, count how many integers in [start, end] are divisible by the divisor.

multiples range divisibility
+10 pts 10m
Python Basics easy

Sum from 1 to n

Write a function that returns the sum of all integers from 1 to n (inclusive).

math arithmetic sum
+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

Round to nearest ten

Write a function that rounds any integer to the nearest multiple of ten.

arithmetic rounding integers
+8 pts 10m
Python Basics easy

Modulo Remainder

Implement a function that returns the remainder of a divided by b without using the modulo operator.

modulo arithmetic integers
+5 pts 5m
Python Basics easy

Last Digit Extractor

Write a function that returns the last digit of a non-negative integer using the modulo operator.

integers modulo arithmetic
+5 pts 5m
Python Basics easy

Find Missing Number

Given a list of n distinct integers from 0..n with one missing, return the missing number.

math integers arrays
+10 pts 10m
Python Basics easy

Map, Filter, Reduce

Implement three functions using map, filter, and reduce to manipulate a list of integers.

map filter reduce
+10 pts 15m
Python Basics easy

Count trailing zeros

Write a function that counts the number of trailing zeros in the decimal representation of a positive integer.

loops integers basics
+5 pts 5m
Python Basics easy

Count Leading Zeros

Write a function that returns the number of leading zeros in a list of integers.

lists iteration counting
+8 pts 8m

Showing 18 challenges · Python Basics

Python Basics — Python coding challenges

What you will find here

This page lists python basics challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.

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.