Challenges

Python challenges

Classic Python: the challenge's words on the left, your code on the right, and Check runs its tests. No game: just Python, files and you.

A random challenge by level

Level 1: One idea at a time, explained with an example.

1

Python basics

Classic challenges: printing, input, numbers, if, loops, text, functions and files.

Levels 1–40 of 3 solved
  1. 1-1Hello, world
  2. 1-2Greet by name
  3. 1-3Add two numbers
2

Printing and variables

The first steps: print text and numbers, keep values in variables, and put them together.

Level 10 of 8 solved
  1. 2-1Two lines
  2. 2-2A box of stars
  3. 2-3Python counts
  4. 2-4Separators and ends
  5. 2-5A receipt
  6. 2-6A name card
  7. 2-7Swap them
  8. 2-8Seconds
3

Input and arithmetic

Ask for numbers, turn text into numbers, and calculate: whole parts, remainders and decimals.

Levels 1–20 of 3 solved
  1. 3-1A rectangle
  2. 3-2Degrees Fahrenheit
  3. 3-3Sharing sweets
4

Conditions

Let the program choose: if, elif and else, comparing numbers, and joining conditions with and / or.

Levels 1–30 of 3 solved
  1. 4-1The bigger one
  2. 4-2Passed or not
  3. 4-3Positive, negative or zero
5

Loops

Do it again: for and range, while, adding up as you go, counting, and loops inside loops.

Levels 1–30 of 1 solved
  1. 5-1From 1 to n
6

Text

Work with words: letters by their place, slices, upper and lower case, counting, splitting and joining.

Levels 1–30 of 2 solved
  1. 6-1Shout it
  2. 6-2First and last
8

Functions

Name a piece of code and use it again: def, parameters, return, and functions that use each other.

Levels 1–30 of 1 solved
  1. 8-1Your first function