Intro programming coding challenges

Practise intro programming with 40 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 · 14 Hard · 2

Skills you'll practise: 2D arraysCase-insensitive comparisonInput validationInteger money mathInteger roundingString building2D boolean grids2D grid traversalAccumulatorsArithmetic expressionsArray scanningBit shifting
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
341
Challenges
241
Solutions shared
9
Languages

All challenges

Search by name or topic, or filter by difficulty.

40 challenges
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
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

Password Modifier

Strengthen a password by swapping some letters for symbols and adding its length at the end.

You'll learn Character replacementString building
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Simple Statistics

Return the minimum, maximum and average of a list of whole numbers.

You'll learn AccumulatorsRunning minimum and maximum
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Medium

Ticket Lottery Winners

Count how many lottery tickets matched 0, 1, 2, ... of the winning numbers.

You'll learn Set membershipFrequency counts
CS1GamesHomeworkIntermediateIntro programmingStudent-beginner
No solutions yet
Medium

Spell Checker

List the words in a text that are missing from a dictionary, ignoring case and punctuation.

You'll learn Hash setsTokenizing text
CS1CS50 styleDictionariesHash tablesHomeworkIntermediateIntro programmingStudent-beginner
No solutions yet
Medium

Box Blur

Blur a grayscale image by replacing each pixel with the rounded average of its 3 by 3 neighborhood.

You'll learn Neighborhood loopsBounds checking
CS1CS50 styleGridsHomeworkImage processingIntermediateIntro programmingMatricesStudent-beginner
No solutions yet
Hard

Ranked Pairs Winner

Find the ranked pairs winner of an election by locking head-to-head victories that do not make a cycle.

You'll learn Graph cycle detectionCustom sorting
AdvancedCS1CS50 styleHomeworkIntro programmingSortingStudent-beginnerVoting
No solutions yet
Easy

Smallest of Three

Return the smallest of three integers.

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

Mad Lib Builder

Fill the bracketed blanks of a story template with words, in order.

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

Output Range With Increment

List the numbers from a start value toward an end value, moving by a fixed step.

You'll learn Loop conditionsEdge cases
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Caffeine Half-Life

Find how much caffeine is left in the body after a number of hours, given its half-life.

You'll learn ExponentsFloating point math
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Gradebook Letter Counts

Turn a whole class's scores into letter grades and count how many students got each letter.

You'll learn If-else chainsCounting with an array
BeginnerCS1HomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Middle Item

Read numbers up to a negative sentinel and return the middle one.

You'll learn Sentinel valuesList indexing
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Medium

Longest Run of Rolls

Find where the longest run of equal consecutive dice rolls starts and how long it is.

You'll learn Array scanningTracking the best result
AP Computer ScienceCS1ClassesDiceHomeworkIntermediateIntro programmingOOPProbabilityStudent-beginner
No solutions yet
Medium

Light Board

Simulate a board of lights where pressing one flips it and its neighbors, and answer count queries.

You'll learn 2D boolean gridsNeighbor offsets
AP Computer ScienceCS1ClassesGridsHomeworkIntermediateIntro programmingMatricesOOPStudent-beginner
No solutions yet
Easy

Contains the Character

Keep only the words that contain a given letter, ignoring case.

You'll learn Case-insensitive comparisonFiltering a list
BeginnerCS1HomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Coin Toss Streaks

Find the longest streak of heads, the longest streak of tails and the number of streaks in a coin toss record.

You'll learn Run detectionCounting
BeginnerCS1DiceHomeworkIntro programmingProbabilityStudent-beginner
No solutions yet