Volume of Cube
Write a Python function that returns the volume of a cube given its side length.
Modulo Remainder
Implement a function that returns the remainder of a divided by b without using the modulo operator.
Print Pyramid Pattern
Implement a function that returns a centered asterisk pyramid as a list of strings.
Last Digit Extractor
Write a function that returns the last digit of a non-negative integer using the modulo operator.
Count word occurrences
Write a function that takes a sentence and returns a dictionary of word counts.
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.
Count Leading Zeros
Write a function that returns the number of leading zeros in a list of integers.
Copy deep vs shallow
Predict and write a function that returns a copied list and inspect whether nested modification affects the original.
Limit and Offset Query
Write a function that returns a page from a dataset given limit and offset.
Array mean and std
Implement the function array_stats that returns the mean and population standard deviation of a list of numbers.
Cumulative Sum Vectorized
Implement a function that returns the cumulative sum of a list of numbers.
Invariant checker
Implement check_invariant(a, b, c) that returns True when a equals b plus c and False otherwise, matching the given examples.
Argmax along axis
Write a function that returns index positions of the maximum values along rows or columns of a 2D list.
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.