Temperature converter
Convert Celsius to Fahrenheit: F = C × 9/5 + 32.
Sum of digits
Return the sum of all decimal digits of a non-negative integer.
Sum numbers from 1 to n
Implement a function that computes the sum of all integers from 1 to n.
Seconds to Hours Minutes Seconds
Convert total seconds into a zero-padded HH:MM:SS format.
Digit count of an integer
Given an integer, return the number of digits it has, handling negatives and zero correctly.
Toggle a boolean n times
Apply boolean toggling n times and return the final boolean value.
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.
Simple Interest Calculator
Implement a function that calculates simple interest given principal, annual rate, and time in years.
Tip Calculator
Write a function that calculates the total bill after adding a given tip percentage.
Absolute Difference
Implement a function that returns the absolute difference between two numbers.
Sum from 1 to n
Write a function that returns the sum of all integers from 1 to n (inclusive).
Round to nearest ten
Write a function that rounds any integer to the nearest multiple of ten.
Fahrenheit to Celsius
Implement a function that converts degrees Fahrenheit to degrees Celsius.
Speed Converter
Write a function to convert speeds between kilometers per hour and meters per second.
Area of Rectangle
Write a function that returns the area of a rectangle given its width and height.
Perimeter of triangle
Given three side lengths, return the perimeter (sum) of the triangle.
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.
Digit Count
Count the number of digits in an integer using arithmetic, without string conversion.
Last Digit Extractor
Write a function that returns the last digit of a non-negative integer using the modulo operator.
Showing 20 challenges · easy · 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.