Conditions coding challenges

Practise conditions with 25 coding challenges, from easy to hard. Every challenge runs in your browser with instant tests, an AI review of your code and community solutions to compare.

Easy · 24 Medium · 1

Skills you'll practise: ComparisonsInput validationAccumulatorsAge rangesBoolean flagsBoundary valuesBranchingCalendar rulesCeiling divisionChained conditionsCharacter replacementCombining conditions
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
341
Challenges
245
Solutions shared
9
Languages

All challenges

Search by name or topic, or filter by difficulty.

25 challenges
Easy

Days in a Month

Return how many days a month has, including leap years.

You'll learn Calendar rulesHelper functions
BeginnerConditionsFunctionsLearning-path
Medium

Tic-Tac-Toe Winner

Decide the result of a tic-tac-toe board.

You'll learn Win conditionsDiagonals
BeginnerConditionsGridsLearning-path
Easy

Password Rules Check

Check a password against simple strength rules.

You'll learn ValidationBoolean flags
BeginnerConditionsLearning-pathStrings
Easy

Largest of Three

Pick the largest of three numbers without a built-in max.

You'll learn ComparisonsCombining conditions
BeginnerConditionsLearning-path
Easy

Triangle Classification

Classify three side lengths as invalid, equilateral, isosceles, or scalene.

You'll learn Triangle inequalityOrdering conditions
ConditionsGeometry
Easy

Absolute Value Without abs

Compute an absolute value with a condition.

You'll learn NegationNo built-ins
BeginnerConditionsLearning-path
Easy

Letter Grade

Turn a test score into a letter grade.

You'll learn if/elif chainsRanges
BeginnerConditionsLearning-path
Easy

Point Quadrant

Find which quadrant a point lies in.

You'll learn CoordinatesSign checks
BeginnerConditionsLearning-path
Easy

Ticket Price by Age

Choose a cinema ticket price from the visitor's age.

You'll learn Age rangesBoundary values
BeginnerConditionsLearning-path
Easy

Payroll With Overtime

Compute each employee's weekly pay in cents with time and a half after 40 hours and double time after 50.

You'll learn Piecewise rulesInteger rounding
BeginnerCS1ConditionsFinanceFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Tip Calculator

Work out the tip, the total and each person's share of a restaurant bill, all in cents.

You'll learn Integer money mathRounding rules
BeginnerCS1ConditionsFinanceFunctionsHomeworkIntro programmingStacksStudent-beginner
No solutions yet
Easy

Temperature Table

Build a Fahrenheit to Celsius conversion table with one decimal place.

You'll learn Loops with a stepNumber formatting
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Shipping Cost Function

Complete the function that prices a package from its weight in ounces and the delivery speed.

You'll learn Ceiling divisionFunction parameters
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Smallest Multiple

Find the smallest positive number that every integer in a range divides evenly.

You'll learn Greatest common divisorLeast common multiple
BeginnerCompetitive-programmingConditionsFinanceFunctionsNumber-theoryProject Euler stylemath
No solutions yet
Easy

Smallest of Three

Return the smallest of three integers.

You'll learn ComparisonsVariables
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Remove Gray From RGB

Remove the gray part of an RGB color by subtracting the smallest channel from all three.

You'll learn Minimum of valuesInput validation
BeginnerBit manipulationCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Interstate Highway Numbers

Classify an interstate highway number as a primary or auxiliary route and give its direction.

You'll learn Remainder arithmeticBranching
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Season From Month and Day

Given a month name and a day, return the season of the year in the Northern Hemisphere.

You'll learn Chained conditionsInput validation
BeginnerCS1ConditionsDates and timesFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet