Practice Arena

Python Coding Challenges

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

925 challenges 556 easy 323 medium 46 hard
Python Basics easy

Volume of Cube

Write a Python function that returns the volume of a cube given its side length.

arithmetic return function
+5 pts 5m
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

Print Pyramid Pattern

Implement a function that returns a centered asterisk pyramid as a list of strings.

loops strings pattern-printing
+10 pts 15m
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

Count word occurrences

Write a function that takes a sentence and returns a dictionary of word counts.

strings counting dictionaries
+10 pts 15m
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

Count Leading Zeros

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

lists iteration counting
+8 pts 8m
Python Basics easy

Copy deep vs shallow

Predict and write a function that returns a copied list and inspect whether nested modification affects the original.

copy nested mutation
+8 pts 10m
Python Basics easy

Limit and Offset Query

Write a function that returns a page from a dataset given limit and offset.

pagination list slicing
+8 pts 10m
Python Basics easy

Array mean and std

Implement the function array_stats that returns the mean and population standard deviation of a list of numbers.

statistics mean std
+10 pts 15m
Python Basics easy

Cumulative Sum Vectorized

Implement a function that returns the cumulative sum of a list of numbers.

lists cumulative sum
+10 pts 10m
Python Basics easy

Invariant checker

Implement check_invariant(a, b, c) that returns True when a equals b plus c and False otherwise, matching the given examples.

functions conditionals validation
+8 pts 10m
Python Basics easy

Argmax along axis

Write a function that returns index positions of the maximum values along rows or columns of a 2D list.

lists max index
+10 pts 10m

Showing 25–37 of 37 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.