Lessons

Basics

54
Beginner

Hello Python World

Learn to print your first message in Python

Basics
Beginner

Variables and Numbers

Store and use numbers in variables

Basics
Beginner

Simple Math Operations in Python

Learn how to perform basic math operations using Python.

Basics
Beginner

String Fun

Work with text in Python

Basics
Beginner

Print Multiple Lines

Learn to print multiple messages

Basics
Beginner

Numbers and Math

Work with different numbers

Basics
Beginner

Subtraction Fun

Practice subtraction in Python

Basics
Beginner

Multiplication Magic

Multiply numbers together

Basics
Beginner

Division Basics

Divide numbers in Python

Basics
Beginner

Comments in Code

Add comments to explain code

Basics
Beginner

Variable Names

Learn good variable naming

Basics
Beginner

Number Comparison

Compare numbers with operators

Basics
Beginner

Boolean Values

Work with True and False

Basics
Beginner

Multiple Variables

Create several variables at once

Basics
Beginner

Modulo Operator

Find remainders with modulo

Basics
Beginner

Power Operator

Learn how to use the power operator (**) to calculate exponents in Python.

Basics
Beginner

Integer Division

Divide without decimals

Basics
Beginner

Greet Ada

Print exactly: Hi Ada, welcome to Python!

Basics
Beginner

Negative Indexing

Access items from the end

Basics
Beginner

Type Conversion - String to Int

Convert text to numbers

Basics
Beginner

Type Conversion - Int to String

Convert numbers to text

Basics
Beginner

Is 14 even or odd?

Print 'even' if 14 is even, else 'odd'.

Basics
Beginner

Absolute Value

Get positive version of numbers

Basics
Beginner

Round Function

Round decimal numbers

Basics
Beginner

Logical AND

Combine conditions with AND

Basics
Beginner

Is 14 greater than 3?

Print whether 14 > 3 (True or False).

Basics
Beginner

Logical OR

Combine conditions with OR

Basics
Beginner

Logical NOT

Invert boolean values

Basics
Beginner

In Operator

Check if item exists

Basics
Beginner

Using the "not in" Operator

Check if an item does not exist in a list or string using the "not in" operator.

Basics
Beginner

Identity Operator

Check if variables are same object

Basics
Beginner

Add 3 to the text "14"

14 is a string. Convert it to a number, add 3, print the result.

Basics
Beginner

Remainder of 14 ÷ 3

Print the remainder of 14 divided by 3 using %.

Basics
Beginner

Greet Sam

Print exactly: Hi Sam, welcome to coding!

Basics
Beginner

Is 7 even or odd?

Print 'even' if 7 is even, else 'odd'.

Basics
Beginner

Is 7 greater than 5?

Print whether 7 > 5 (True or False).

Basics
Beginner

Add 5 to the text "7"

7 is a string. Convert it to a number, add 5, print the result.

Basics
Beginner

Remainder of 7 ÷ 5

Print the remainder of 7 divided by 5 using %.

Basics
Beginner

Greet Mia

Print exactly: Hi Mia, welcome to Python!

Basics
Beginner

Is 40 even or odd?

Print 'even' if 40 is even, else 'odd'.

Basics
Beginner

Is 40 greater than 6?

Print whether 40 > 6 (True or False).

Basics
Beginner

Add 6 to the text "40"

40 is a string. Convert it to a number, add 6, print the result.

Basics
Beginner

Remainder of 40 ÷ 6

Print the remainder of 40 divided by 6 using %.

Basics
Beginner

Greet Leo

Print exactly: Hi Leo, welcome to programming!

Basics
Beginner

Is 42 even or odd?

Print 'even' if 42 is even, else 'odd'.

Basics
Beginner

Is 42 greater than 8?

Print whether 42 > 8 (True or False).

Basics
Beginner

Add 8 to the text "42"

42 is a string. Convert it to a number, add 8, print the result.

Basics
Beginner

Remainder of 42 ÷ 8

Print the remainder of 42 divided by 8 using %.

Basics
Beginner

Greet Noa

Print exactly: Hi Noa, welcome to Python!

Basics
Beginner

Is 100 even or odd?

Print 'even' if 100 is even, else 'odd'.

Basics
Beginner

Is 100 greater than 7?

Print whether 100 > 7 (True or False).

Basics
Beginner

Add 7 to the text "100"

100 is a string. Convert it to a number, add 7, print the result.

Basics
Beginner

Remainder of 100 ÷ 7

Print the remainder of 100 divided by 7 using %.

Basics
Beginner

Greet Eli

Print exactly: Hi Eli, welcome to coding!

Basics

Control Flow

58
Intermediate

If Statements

Make decisions in your code

Control Flow
Intermediate

Loops - For

Repeat code multiple times

Control Flow
Intermediate

If-Else Statement

Handle both true and false cases

Control Flow
Intermediate

Elif Statement

Check multiple conditions

Control Flow
Intermediate

While Loop

Repeat code while condition is true

Control Flow
Intermediate

For Loop with Range

Loop through a range of numbers

Control Flow
Intermediate

Using 'break' in Loops

Learn how to use the 'break' statement to exit loops prematurely.

Control Flow
Intermediate

Continue Statement

Skip to next loop iteration

Control Flow
Intermediate

FizzBuzz to 15

For 1..15: print Fizz (÷3), Buzz (÷5), FizzBuzz (both), else the number.

Control Flow
Intermediate

Letter grade for 85

A score of 85: print 'A' (>=90), 'B' (>=80), 'C' (>=70), else 'F'.

Control Flow
Intermediate

Is 2024 a leap year?

Print True if 2024 is a leap year (divisible by 4 and not by 100, or by 400).

Control Flow
Intermediate

Sign of 7

Print 'positive', 'negative' or 'zero' for 7.

Control Flow
Intermediate

Larger of 9 and 4 without max()

Without using max(), print the larger of 9 and 4 using an if.

Control Flow
Intermediate

Age group of 16

For age 16 print 'child' (<13), 'teen' (13-19) or 'adult' (>=20).

Control Flow
Intermediate

FizzBuzz to 20

For 1..20: print Fizz (÷3), Buzz (÷5), FizzBuzz (both), else the number.

Control Flow
Intermediate

Letter grade for 72

A score of 72: print 'A' (>=90), 'B' (>=80), 'C' (>=70), else 'F'.

Control Flow
Intermediate

Is 1900 a leap year?

Print True if 1900 is a leap year (divisible by 4 and not by 100, or by 400).

Control Flow
Intermediate

Sign of -3

Print 'positive', 'negative' or 'zero' for -3.

Control Flow
Intermediate

Larger of 12 and 5 without max()

Without using max(), print the larger of 12 and 5 using an if.

Control Flow
Intermediate

Age group of 11

For age 11 print 'child' (<13), 'teen' (13-19) or 'adult' (>=20).

Control Flow
Intermediate

FizzBuzz to 30

For 1..30: print Fizz (÷3), Buzz (÷5), FizzBuzz (both), else the number.

Control Flow
Intermediate

Letter grade for 68

A score of 68: print 'A' (>=90), 'B' (>=80), 'C' (>=70), else 'F'.

Control Flow
Intermediate

Is 2000 a leap year?

Print True if 2000 is a leap year (divisible by 4 and not by 100, or by 400).

Control Flow
Intermediate

Sign of 0

Print 'positive', 'negative' or 'zero' for 0.

Control Flow
Intermediate

Larger of 3 and 8 without max()

Without using max(), print the larger of 3 and 8 using an if.

Control Flow
Intermediate

Age group of 25

For age 25 print 'child' (<13), 'teen' (13-19) or 'adult' (>=20).

Control Flow
Intermediate

FizzBuzz to 12

For 1..12: print Fizz (÷3), Buzz (÷5), FizzBuzz (both), else the number.

Control Flow
Intermediate

Letter grade for 91

A score of 91: print 'A' (>=90), 'B' (>=80), 'C' (>=70), else 'F'.

Control Flow
Intermediate

Is 2023 a leap year?

Print True if 2023 is a leap year (divisible by 4 and not by 100, or by 400).

Control Flow
Intermediate

Sign of -10

Print 'positive', 'negative' or 'zero' for -10.

Control Flow
Intermediate

Larger of 20 and 20 without max()

Without using max(), print the larger of 20 and 20 using an if.

Control Flow
Intermediate

Age group of 19

For age 19 print 'child' (<13), 'teen' (13-19) or 'adult' (>=20).

Control Flow
Intermediate

FizzBuzz to 18

For 1..18: print Fizz (÷3), Buzz (÷5), FizzBuzz (both), else the number.

Control Flow
Intermediate

Letter grade for 59

A score of 59: print 'A' (>=90), 'B' (>=80), 'C' (>=70), else 'F'.

Control Flow
Intermediate

Is 2100 a leap year?

Print True if 2100 is a leap year (divisible by 4 and not by 100, or by 400).

Control Flow
Intermediate

Sign of 5

Print 'positive', 'negative' or 'zero' for 5.

Control Flow
Intermediate

Larger of 1 and 2 without max()

Without using max(), print the larger of 1 and 2 using an if.

Control Flow
Intermediate

Age group of 13

For age 13 print 'child' (<13), 'teen' (13-19) or 'adult' (>=20).

Control Flow
Intermediate

FizzBuzz to 25

For 1..25: print Fizz (÷3), Buzz (÷5), FizzBuzz (both), else the number.

Control Flow
Intermediate

Letter grade for 77

A score of 77: print 'A' (>=90), 'B' (>=80), 'C' (>=70), else 'F'.

Control Flow
Intermediate

Is 1996 a leap year?

Print True if 1996 is a leap year (divisible by 4 and not by 100, or by 400).

Control Flow
Intermediate

Sign of -1

Print 'positive', 'negative' or 'zero' for -1.

Control Flow
Intermediate

Larger of 15 and 30 without max()

Without using max(), print the larger of 15 and 30 using an if.

Control Flow
Intermediate

Age group of 7

For age 7 print 'child' (<13), 'teen' (13-19) or 'adult' (>=20).

Control Flow
Intermediate

FizzBuzz to 10

For 1..10: print Fizz (÷3), Buzz (÷5), FizzBuzz (both), else the number.

Control Flow
Intermediate

Letter grade for 100

A score of 100: print 'A' (>=90), 'B' (>=80), 'C' (>=70), else 'F'.

Control Flow
Intermediate

Is 2400 a leap year?

Print True if 2400 is a leap year (divisible by 4 and not by 100, or by 400).

Control Flow
Intermediate

Sign of 42

Print 'positive', 'negative' or 'zero' for 42.

Control Flow
Intermediate

Larger of 8 and 8 without max()

Without using max(), print the larger of 8 and 8 using an if.

Control Flow
Intermediate

Age group of 45

For age 45 print 'child' (<13), 'teen' (13-19) or 'adult' (>=20).

Control Flow
Intermediate

FizzBuzz to 50

For 1..50: print Fizz (÷3), Buzz (÷5), FizzBuzz (both), else the number.

Control Flow
Intermediate

Letter grade for 64

A score of 64: print 'A' (>=90), 'B' (>=80), 'C' (>=70), else 'F'.

Control Flow
Intermediate

Is 1999 a leap year?

Print True if 1999 is a leap year (divisible by 4 and not by 100, or by 400).

Control Flow
Intermediate

Sign of -7

Print 'positive', 'negative' or 'zero' for -7.

Control Flow
Intermediate

Larger of 6 and 11 without max()

Without using max(), print the larger of 6 and 11 using an if.

Control Flow
Intermediate

Age group of 20

For age 20 print 'child' (<13), 'teen' (13-19) or 'adult' (>=20).

Control Flow
Intermediate

FizzBuzz to 22

For 1..22: print Fizz (÷3), Buzz (÷5), FizzBuzz (both), else the number.

Control Flow
Intermediate

Letter grade for 92

A score of 92: print 'A' (>=90), 'B' (>=80), 'C' (>=70), else 'F'.

Control Flow

Data Structures

62
Intermediate

Lists - Collections of Items 📋

Store multiple items in a list

Data Structures
Intermediate

List Creation

Create and print a list

Data Structures
Intermediate

List Indexing

Access list items by position

Data Structures
Intermediate

List Append

Add items to a list using append

Data Structures
Intermediate

List Iteration

Loop through list items

Data Structures
Intermediate

Dictionary Basics

Store key-value pairs

Data Structures
Intermediate

List Slicing

Extract portions of lists

Data Structures
Intermediate

Tuple Basics

Work with immutable sequences

Data Structures
Intermediate

Set Basics

Work with unique collections

Data Structures
Intermediate

List Remove

Remove items from lists

Data Structures
Intermediate

Dictionary Update

Add or change dictionary values

Data Structures
Intermediate

Nested Lists

Work with lists inside lists

Data Structures
Intermediate

Word counts in a 3-item list

Count each item in ['red', 'blue', 'red'] into a dict and print it.

Data Structures
Intermediate

Sort [3, 1, 2, 1]

Print [3, 1, 2, 1] sorted in ascending order.

Data Structures
Intermediate

Unique values of [3, 1, 2, 1]

Print the unique values of [3, 1, 2, 1], sorted (use a set).

Data Structures
Intermediate

Common items of two lists

Print the sorted values present in BOTH [3, 1, 2, 1] and [2, 3, 4].

Data Structures
Intermediate

Highest value's key

In the dict {'a': 3, 'b': 7}, print the key with the largest value.

Data Structures
Intermediate

Unpack a tuple (5, 9)

Unpack (5, 9) into x and y, then print their sum.

Data Structures
Intermediate

Sum a list of 4

Print the sum of all numbers in [3, 1, 2, 1].

Data Structures
Intermediate

Word counts in a 4-item list

Count each item in ['x', 'y', 'x', 'z'] into a dict and print it.

Data Structures
Intermediate

Sort [8, 4, 8]

Print [8, 4, 8] sorted in ascending order.

Data Structures
Intermediate

Unique values of [8, 4, 8]

Print the unique values of [8, 4, 8], sorted (use a set).

Data Structures
Intermediate

Common items of two lists (['x', 'y', 'x', 'z'])

Print the sorted values present in BOTH [8, 4, 8] and [4, 9, 1].

Data Structures
Intermediate

Highest value's key (['x', 'y', 'x', 'z'])

In the dict {'p': 10, 'q': 2}, print the key with the largest value.

Data Structures
Intermediate

Unpack a tuple (2, 6)

Unpack (2, 6) into x and y, then print their sum.

Data Structures
Intermediate

Sum a list of 3

Print the sum of all numbers in [8, 4, 8].

Data Structures
Intermediate

Word counts in a 3-item list (['cat', 'dog', 'cat'])

Count each item in ['cat', 'dog', 'cat'] into a dict and print it.

Data Structures
Intermediate

Sort [5, 5, 1, 2]

Print [5, 5, 1, 2] sorted in ascending order.

Data Structures
Intermediate

Unique values of [5, 5, 1, 2]

Print the unique values of [5, 5, 1, 2], sorted (use a set).

Data Structures
Intermediate

Common items of two lists (['cat', 'dog', 'cat'])

Print the sorted values present in BOTH [5, 5, 1, 2] and [5, 2, 7].

Data Structures
Intermediate

Highest value's key (['cat', 'dog', 'cat'])

In the dict {'m': 1, 'n': 9}, print the key with the largest value.

Data Structures
Intermediate

Unpack a tuple (11, 4)

Unpack (11, 4) into x and y, then print their sum.

Data Structures
Intermediate

Sum a list of 4 (['cat', 'dog', 'cat'])

Print the sum of all numbers in [5, 5, 1, 2].

Data Structures
Intermediate

Word counts in a 3-item list (['a', 'b', 'c'])

Count each item in ['a', 'b', 'c'] into a dict and print it.

Data Structures
Intermediate

Sort [9, 3, 6]

Print [9, 3, 6] sorted in ascending order.

Data Structures
Intermediate

Unique values of [9, 3, 6]

Print the unique values of [9, 3, 6], sorted (use a set).

Data Structures
Intermediate

Common items of two lists (['a', 'b', 'c'])

Print the sorted values present in BOTH [9, 3, 6] and [6, 1, 3].

Data Structures
Intermediate

Highest value's key (['a', 'b', 'c'])

In the dict {'k': 4, 'j': 8}, print the key with the largest value.

Data Structures
Intermediate

Unpack a tuple (7, 7)

Unpack (7, 7) into x and y, then print their sum.

Data Structures
Intermediate

Sum a list of 3 (['a', 'b', 'c'])

Print the sum of all numbers in [9, 3, 6].

Data Structures
Intermediate

Word counts in a 3-item list (['up', 'up', 'down'])

Count each item in ['up', 'up', 'down'] into a dict and print it.

Data Structures
Intermediate

Sort [2, 2, 2, 5]

Print [2, 2, 2, 5] sorted in ascending order.

Data Structures
Intermediate

Unique values of [2, 2, 2, 5]

Print the unique values of [2, 2, 2, 5], sorted (use a set).

Data Structures
Intermediate

Common items of two lists (['up', 'up', 'down'])

Print the sorted values present in BOTH [2, 2, 2, 5] and [5, 8, 2].

Data Structures
Intermediate

Highest value's key (['up', 'up', 'down'])

In the dict {'s': 6, 't': 6}, print the key with the largest value.

Data Structures
Intermediate

Unpack a tuple (3, 12)

Unpack (3, 12) into x and y, then print their sum.

Data Structures
Intermediate

Sum a list of 4 (['up', 'up', 'down'])

Print the sum of all numbers in [2, 2, 2, 5].

Data Structures
Intermediate

Sort [4, 2, 3, 2]

Print [4, 2, 3, 2] sorted in ascending order.

Data Structures
Intermediate

Unique values of [4, 2, 3, 2]

Print the unique values of [4, 2, 3, 2], sorted (use a set).

Data Structures
Intermediate

Common items of two lists (['red', 'blue', 'red'])

Print the sorted values present in BOTH [4, 2, 3, 2] and [3, 4, 5].

Data Structures
Intermediate

Sum a list of 4 (['red', 'blue', 'red'])

Print the sum of all numbers in [4, 2, 3, 2].

Data Structures
Intermediate

Sort [9, 5, 9]

Print [9, 5, 9] sorted in ascending order.

Data Structures
Intermediate

Unique values of [9, 5, 9]

Print the unique values of [9, 5, 9], sorted (use a set).

Data Structures
Intermediate

Common items of two lists (['x', 'y', 'x', 'z']·2)

Print the sorted values present in BOTH [9, 5, 9] and [5, 10, 2].

Data Structures
Intermediate

Sum a list of 3 (['x', 'y', 'x', 'z'])

Print the sum of all numbers in [9, 5, 9].

Data Structures
Intermediate

Sort [6, 6, 2, 3]

Print [6, 6, 2, 3] sorted in ascending order.

Data Structures
Intermediate

Unique values of [6, 6, 2, 3]

Print the unique values of [6, 6, 2, 3], sorted (use a set).

Data Structures
Intermediate

Common items of two lists (['cat', 'dog', 'cat']·2)

Print the sorted values present in BOTH [6, 6, 2, 3] and [6, 3, 8].

Data Structures
Intermediate

Sum a list of 4 (['cat', 'dog', 'cat']·2)

Print the sum of all numbers in [6, 6, 2, 3].

Data Structures
Intermediate

Sort [10, 4, 7]

Print [10, 4, 7] sorted in ascending order.

Data Structures
Intermediate

Unique values of [10, 4, 7]

Print the unique values of [10, 4, 7], sorted (use a set).

Data Structures
Intermediate

Common items of two lists (['a', 'b', 'c']·2)

Print the sorted values present in BOTH [10, 4, 7] and [7, 2, 4].

Data Structures

Functions

63
Advanced

Functions

Create reusable code with functions

Functions
Intermediate

Function with Parameters

Create functions that take inputs

Functions
Intermediate

Multiple Return Values

Return multiple values from functions

Functions
Intermediate

Default Parameters

Set default values for parameters

Functions
Intermediate

Max and Min

Find largest and smallest values

Functions
Intermediate

Sum Function

Add all numbers in a list using the sum function.

Functions
Intermediate

Enumerate Function

Get index and value in loops

Functions
Intermediate

Zip Function

Combine multiple lists

Functions
Intermediate

Sorted Function

Sort lists without changing original

Functions
Intermediate

Reversed Function: Reversing List Order

Learn to reverse the order of items in a list using the reversed() function in Python.

Functions
Advanced

Lambda Functions

Create small anonymous functions

Functions
Advanced

Map Function

Apply function to all list items

Functions
Advanced

Filter Function

Filter list items by condition

Functions
Intermediate

Square of 9

Write square(x) returning x*x, then print square(9).

Functions
Intermediate

Default argument adds 1

Write add(a, b=1) returning a+b. Print add(9).

Functions
Intermediate

Sum any count of args (3 numbers)

Write total(*nums) returning their sum. Print total of [1, 2, 3].

Functions
Intermediate

Return two values (min & max)

Write minmax(nums) returning (min, max). Print it for [1, 2, 3].

Functions
Intermediate

Lambda triples 9

Make a lambda `triple` that returns x*3, then print triple(9).

Functions
Intermediate

Function returning a string

Write shout(s) returning s in uppercase with '!'. Print shout('python').

Functions
Intermediate

Recursive factorial of 9

Write a recursive factorial(n) and print factorial(9).

Functions
Intermediate

Square of 7

Write square(x) returning x*x, then print square(7).

Functions
Intermediate

Default argument adds 5

Write add(a, b=5) returning a+b. Print add(7).

Functions
Intermediate

Sum any count of args (4 numbers)

Write total(*nums) returning their sum. Print total of [4, 5, 6, 7].

Functions
Intermediate

Return two values (min & max) ([4, 5, 6, 7])

Write minmax(nums) returning (min, max). Print it for [4, 5, 6, 7].

Functions
Intermediate

Lambda triples 7

Make a lambda `triple` that returns x*3, then print triple(7).

Functions
Intermediate

Function returning a string ([4, 5, 6, 7])

Write shout(s) returning s in uppercase with '!'. Print shout('hello').

Functions
Intermediate

Recursive factorial of 7

Write a recursive factorial(n) and print factorial(7).

Functions
Intermediate

Square of 6

Write square(x) returning x*x, then print square(6).

Functions
Intermediate

Default argument adds 2

Write add(a, b=2) returning a+b. Print add(6).

Functions
Intermediate

Sum any count of args (3 numbers) ([10, 20, 30])

Write total(*nums) returning their sum. Print total of [10, 20, 30].

Functions
Intermediate

Return two values (min & max) ([10, 20, 30])

Write minmax(nums) returning (min, max). Print it for [10, 20, 30].

Functions
Intermediate

Lambda triples 6

Make a lambda `triple` that returns x*3, then print triple(6).

Functions
Intermediate

Function returning a string ([10, 20, 30])

Write shout(s) returning s in uppercase with '!'. Print shout('clean').

Functions
Intermediate

Recursive factorial of 6

Write a recursive factorial(n) and print factorial(6).

Functions
Intermediate

Square of 5

Write square(x) returning x*x, then print square(5).

Functions
Intermediate

Default argument adds 3

Write add(a, b=3) returning a+b. Print add(5).

Functions
Intermediate

Sum any count of args (5 numbers)

Write total(*nums) returning their sum. Print total of [2, 2, 2, 2, 2].

Functions
Intermediate

Return two values (min & max) ([2, 2, 2, 2, 2])

Write minmax(nums) returning (min, max). Print it for [2, 2, 2, 2, 2].

Functions
Intermediate

Lambda triples 5

Make a lambda `triple` that returns x*3, then print triple(5).

Functions
Intermediate

Function returning a string ([2, 2, 2, 2, 2])

Write shout(s) returning s in uppercase with '!'. Print shout('data').

Functions
Intermediate

Recursive factorial of 5

Write a recursive factorial(n) and print factorial(5).

Functions
Intermediate

Square of 8

Write square(x) returning x*x, then print square(8).

Functions
Intermediate

Default argument adds 10

Write add(a, b=10) returning a+b. Print add(8).

Functions
Intermediate

Sum any count of args (3 numbers) ([9, 1, 5])

Write total(*nums) returning their sum. Print total of [9, 1, 5].

Functions
Intermediate

Return two values (min & max) ([9, 1, 5])

Write minmax(nums) returning (min, max). Print it for [9, 1, 5].

Functions
Intermediate

Lambda triples 8

Make a lambda `triple` that returns x*3, then print triple(8).

Functions
Intermediate

Function returning a string ([9, 1, 5])

Write shout(s) returning s in uppercase with '!'. Print shout('spark').

Functions
Intermediate

Recursive factorial of 8

Write a recursive factorial(n) and print factorial(8).

Functions
Intermediate

Square of 4

Write square(x) returning x*x, then print square(4).

Functions
Intermediate

Default argument adds 4

Write add(a, b=4) returning a+b. Print add(4).

Functions
Intermediate

Sum any count of args (4 numbers) ([3, 6, 9, 12])

Write total(*nums) returning their sum. Print total of [3, 6, 9, 12].

Functions
Intermediate

Return two values (min & max) ([3, 6, 9, 12])

Write minmax(nums) returning (min, max). Print it for [3, 6, 9, 12].

Functions
Intermediate

Lambda triples 4

Make a lambda `triple` that returns x*3, then print triple(4).

Functions
Intermediate

Function returning a string ([3, 6, 9, 12])

Write shout(s) returning s in uppercase with '!'. Print shout('cloud').

Functions
Intermediate

Recursive factorial of 4

Write a recursive factorial(n) and print factorial(4).

Functions
Intermediate

Square of 10

Write square(x) returning x*x, then print square(10).

Functions
Intermediate

Default argument adds 2 ([2, 3, 4])

Write add(a, b=2) returning a+b. Print add(10).

Functions
Intermediate

Sum any count of args (4 numbers) ([2, 3, 4])

Write total(*nums) returning their sum. Print total of [2, 3, 4].

Functions
Intermediate

Return two values (min & max) ([2, 3, 4])

Write minmax(nums) returning (min, max). Print it for [2, 3, 4].

Functions
Intermediate

Lambda triples 10

Make a lambda `triple` that returns x*3, then print triple(10).

Functions
Intermediate

Recursive factorial of 10

Write a recursive factorial(n) and print factorial(10).

Functions
Intermediate

Default argument adds 6

Write add(a, b=6) returning a+b. Print add(8).

Functions
Intermediate

Sum any count of args (5 numbers) ([5, 6, 7, 8])

Write total(*nums) returning their sum. Print total of [5, 6, 7, 8].

Functions

Advanced Concepts

54
Advanced

String Methods

Learn how to use string methods like upper, lower, and title.

Advanced Concepts
Intermediate

List Comprehension Basics

Create lists in one line

Advanced Concepts
Advanced

List Comprehension with Condition

Filter while creating lists

Advanced Concepts
Advanced

Dictionary Comprehension

Create dictionaries in one line

Advanced Concepts
Intermediate

Squares up to 5 (comprehension)

Use a list comprehension to print the squares of 1..5.

Advanced Concepts
Intermediate

Filter evens up to 5

Print a list of the even numbers from 1 to 5 using a comprehension.

Advanced Concepts
Intermediate

map() adds 10

Use map with a lambda to add 10 to each item of [1, 2, 3]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate

Print 'index value' for each item of [1, 2, 3] using enumerate.

Advanced Concepts
Intermediate

Pair two lists with zip

Zip [1, 2, 3] and [4, 5, 6] and print the list of pairs.

Advanced Concepts
Intermediate

Dict comprehension of squares to 5

Build a dict mapping i to i*i for 1..5 and print it.

Advanced Concepts
Intermediate

Squares up to 8 (comprehension)

Use a list comprehension to print the squares of 1..8.

Advanced Concepts
Intermediate

Filter evens up to 8

Print a list of the even numbers from 1 to 8 using a comprehension.

Advanced Concepts
Intermediate

map() adds 1

Use map with a lambda to add 1 to each item of [10, 20]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate ([10, 20])

Print 'index value' for each item of [10, 20] using enumerate.

Advanced Concepts
Intermediate

Pair two lists with zip ([10, 20])

Zip [10, 20] and [30, 40] and print the list of pairs.

Advanced Concepts
Intermediate

Dict comprehension of squares to 8

Build a dict mapping i to i*i for 1..8 and print it.

Advanced Concepts
Intermediate

Squares up to 6 (comprehension)

Use a list comprehension to print the squares of 1..6.

Advanced Concepts
Intermediate

Filter evens up to 6

Print a list of the even numbers from 1 to 6 using a comprehension.

Advanced Concepts
Intermediate

map() adds 5

Use map with a lambda to add 5 to each item of [2, 4, 6, 8]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate ([2, 4, 6, 8])

Print 'index value' for each item of [2, 4, 6, 8] using enumerate.

Advanced Concepts
Intermediate

Pair two lists with zip ([2, 4, 6, 8])

Zip [2, 4, 6, 8] and [1, 3, 5, 7] and print the list of pairs.

Advanced Concepts
Intermediate

Dict comprehension of squares to 6

Build a dict mapping i to i*i for 1..6 and print it.

Advanced Concepts
Intermediate

Squares up to 4 (comprehension)

Use a list comprehension to print the squares of 1..4.

Advanced Concepts
Intermediate

Filter evens up to 4

Print a list of the even numbers from 1 to 4 using a comprehension.

Advanced Concepts
Intermediate

map() adds 2

Use map with a lambda to add 2 to each item of [7, 8, 9]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate ([7, 8, 9])

Print 'index value' for each item of [7, 8, 9] using enumerate.

Advanced Concepts
Intermediate

Pair two lists with zip ([7, 8, 9])

Zip [7, 8, 9] and [1, 2, 3] and print the list of pairs.

Advanced Concepts
Intermediate

Dict comprehension of squares to 4

Build a dict mapping i to i*i for 1..4 and print it.

Advanced Concepts
Intermediate

Squares up to 10 (comprehension)

Use a list comprehension to print the squares of 1..10.

Advanced Concepts
Intermediate

Filter evens up to 10

Print a list of the even numbers from 1 to 10 using a comprehension.

Advanced Concepts
Intermediate

map() adds 100

Use map with a lambda to add 100 to each item of [5, 5]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate ([5, 5])

Print 'index value' for each item of [5, 5] using enumerate.

Advanced Concepts
Intermediate

Pair two lists with zip ([5, 5])

Zip [5, 5] and [6, 6] and print the list of pairs.

Advanced Concepts
Intermediate

Dict comprehension of squares to 10

Build a dict mapping i to i*i for 1..10 and print it.

Advanced Concepts
Intermediate

Squares up to 7 (comprehension)

Use a list comprehension to print the squares of 1..7.

Advanced Concepts
Intermediate

Filter evens up to 7

Print a list of the even numbers from 1 to 7 using a comprehension.

Advanced Concepts
Intermediate

map() adds 3

Use map with a lambda to add 3 to each item of [0, 1, 2, 3]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate ([0, 1, 2, 3])

Print 'index value' for each item of [0, 1, 2, 3] using enumerate.

Advanced Concepts
Intermediate

Pair two lists with zip ([0, 1, 2, 3])

Zip [0, 1, 2, 3] and [9, 8, 7, 6] and print the list of pairs.

Advanced Concepts
Intermediate

Dict comprehension of squares to 7

Build a dict mapping i to i*i for 1..7 and print it.

Advanced Concepts
Intermediate

map() adds 17

Use map with a lambda to add 17 to each item of [2, 3, 4]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate ([2, 3, 4])

Print 'index value' for each item of [2, 3, 4] using enumerate.

Advanced Concepts
Intermediate

Pair two lists with zip ([2, 3, 4])

Zip [2, 3, 4] and [5, 6, 7] and print the list of pairs.

Advanced Concepts
Intermediate

Squares up to 9 (comprehension)

Use a list comprehension to print the squares of 1..9.

Advanced Concepts
Intermediate

Filter evens up to 9

Print a list of the even numbers from 1 to 9 using a comprehension.

Advanced Concepts
Intermediate

map() adds 2 ([11, 21])

Use map with a lambda to add 2 to each item of [11, 21]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate ([11, 21])

Print 'index value' for each item of [11, 21] using enumerate.

Advanced Concepts
Intermediate

Pair two lists with zip ([11, 21])

Zip [11, 21] and [31, 41] and print the list of pairs.

Advanced Concepts
Intermediate

Dict comprehension of squares to 9

Build a dict mapping i to i*i for 1..9 and print it.

Advanced Concepts
Intermediate

map() adds 6

Use map with a lambda to add 6 to each item of [3, 5, 7, 9]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate ([3, 5, 7, 9])

Print 'index value' for each item of [3, 5, 7, 9] using enumerate.

Advanced Concepts
Intermediate

Pair two lists with zip ([3, 5, 7, 9])

Zip [3, 5, 7, 9] and [2, 4, 6, 8] and print the list of pairs.

Advanced Concepts
Intermediate

map() adds 3 ([8, 9, 10])

Use map with a lambda to add 3 to each item of [8, 9, 10]; print the list.

Advanced Concepts
Intermediate

Index each item with enumerate ([8, 9, 10])

Print 'index value' for each item of [8, 9, 10] using enumerate.

Advanced Concepts

Strings

50
Beginner

String Concatenation

Combine text strings

Strings
Beginner

String Repetition

Repeat strings multiple times

Strings
Beginner

String Length

Find the length of a string

Strings
Beginner

String Uppercase

Convert text to uppercase

Strings
Beginner

String Lowercase

Convert text to lowercase

Strings
Beginner

String Replace

Replace parts of strings

Strings
Beginner

String Split

Split strings into lists

Strings
Beginner

Finding the Position of a Substring

Learn how to find the position of a substring within a string using Python.

Strings
Intermediate

String Slicing

Extract parts of strings

Strings
Intermediate

String Formatting

Format strings with variables

Strings
Intermediate

String Methods - Strip

Remove whitespace from strings

Strings
Beginner

String First Char

Learn how to access the first character of a string.

Strings
Beginner

String Last Char

Learn how to access the last character of a string in Python.

Strings
Beginner

String Title Case

Learn to capitalize the first letter of each word in a string.

Strings
Beginner

String Count Chars

Learn how to count the number of times a specific character appears in a string using Python.

Strings
Beginner

String Starts With

Learn how to determine if a string starts with a specific prefix.

Strings
Beginner

Uppercase a word: python

Print 'python' in UPPERCASE with .upper().

Strings
Beginner

String Count

Count occurrences in strings

Strings
Beginner

String Startswith

Check if string starts with text

Strings
Beginner

String Endswith

Check if string ends with text

Strings
Beginner

String Title Case

Capitalize first letter of each word

Strings
Beginner

Uppercase a word: banana

Print 'banana' in UPPERCASE with .upper().

Strings
Beginner

Lowercase a word: hello world

Print 'hello world' in lowercase with .lower().

Strings
Beginner

String Join

Join list items into string

Strings
Beginner

Lowercase a word: openSource

Print 'openSource' in lowercase with .lower().

Strings
Beginner

String Isdigit

Check if string is all digits using the isdigit() method.

Strings
Beginner

String Isalpha

Check if string is all letters

Strings
Beginner

String Capitalize

Capitalize first letter only

Strings
Beginner

Title-case a phrase: Mountain

Print 'Mountain' in Title Case with .title().

Strings
Beginner

Title-case a phrase: data science

Print 'data science' in Title Case with .title().

Strings
Beginner

Capitalize the first letter: keyboard

Print 'keyboard' with only the first letter capitalized using .capitalize().

Strings
Beginner

Capitalize the first letter: alabama

Print 'alabama' with only the first letter capitalized using .capitalize().

Strings
Beginner

Swap the case: good morning

Print 'good morning' with its case swapped using .swapcase().

Strings
Beginner

Swap the case: rocket

Print 'rocket' with its case swapped using .swapcase().

Strings
Beginner

Trim the spaces: javascript

Print 'javascript' with the surrounding spaces removed using .strip().

Strings
Beginner

Trim the spaces: quiet river

Print 'quiet river' with the surrounding spaces removed using .strip().

Strings
Beginner

Length of a string: elephant

Print the number of characters in 'elephant' with len().

Strings
Beginner

Length of a string: compiler

Print the number of characters in 'compiler' with len().

Strings
Beginner

Count a letter: byte stream

Print how many times 'a' appears in 'byte stream' using .count().

Strings
Beginner

Count a letter: north star

Print how many times 'a' appears in 'north star' using .count().

Strings
Beginner

Reverse a string: velocity

Print 'velocity' reversed using slicing [::-1].

Strings
Beginner

Reverse a string: cinnamon

Print 'cinnamon' reversed using slicing [::-1].

Strings
Beginner

Replace a letter: green field

In 'green field', replace every 'a' with 'o' and print the result.

Strings
Beginner

Replace a letter: tangerine

In 'tangerine', replace every 'a' with 'o' and print the result.

Strings
Beginner

First word of a phrase: python

Print the first word of 'python' (split on spaces).

Strings
Beginner

First word of a phrase: banana

Print the first word of 'banana' (split on spaces).

Strings
Beginner

First three letters: hello world

Print the first three characters of 'hello world' using slicing.

Strings
Beginner

First three letters: openSource

Print the first three characters of 'openSource' using slicing.

Strings
Beginner

Count the vowels: Mountain

Count the vowels (a, e, i, o, u) in 'Mountain' and print the total.

Strings
Beginner

Count the vowels: data science

Count the vowels (a, e, i, o, u) in 'data science' and print the total.

Strings

Variables

27
Beginner

Create Your First Variable

Store your name in a variable

Variables
Beginner

Add 7 and 3

Variables hold 7 and 3. Print their sum.

Variables
Beginner

Multiply 7 by 3

Print the product of 7 and 3.

Variables
Beginner

Swap 7 and 3

Swap the variables, then print a then b on two lines.

Variables
Beginner

Increase 7 by 5

Start at 7, add 5 with +=, and print the result.

Variables
Beginner

Total of 7, 3 and 5

Three variables hold 7, 3, 5. Print their total.

Variables
Beginner

Difference of 7 and 3

Print 7 minus 3.

Variables
Beginner

Add 12 and 8

Variables hold 12 and 8. Print their sum.

Variables
Beginner

Multiply 12 by 8

Print the product of 12 and 8.

Variables
Beginner

Swap 12 and 8

Swap the variables, then print a then b on two lines.

Variables
Beginner

Increase 12 by 2

Start at 12, add 2 with +=, and print the result.

Variables
Beginner

Total of 12, 8 and 2

Three variables hold 12, 8, 2. Print their total.

Variables
Beginner

Difference of 12 and 8

Print 12 minus 8.

Variables
Beginner

Add 25 and 17

Variables hold 25 and 17. Print their sum.

Variables
Beginner

Multiply 25 by 17

Print the product of 25 and 17.

Variables
Beginner

Swap 25 and 17

Swap the variables, then print a then b on two lines.

Variables
Beginner

Increase 25 by 10

Start at 25, add 10 with +=, and print the result.

Variables
Beginner

Total of 25, 17 and 10

Three variables hold 25, 17, 10. Print their total.

Variables
Beginner

Difference of 25 and 17

Print 25 minus 17.

Variables
Beginner

Add 6 and 4

Variables hold 6 and 4. Print their sum.

Variables
Beginner

Multiply 6 by 4

Print the product of 6 and 4.

Variables
Beginner

Swap 6 and 4

Swap the variables, then print a then b on two lines.

Variables
Beginner

Increase 6 by 3

Start at 6, add 3 with +=, and print the result.

Variables
Beginner

Total of 6, 4 and 3

Three variables hold 6, 4, 3. Print their total.

Variables
Beginner

Difference of 6 and 4

Print 6 minus 4.

Variables
Beginner

Add 9 and 7

Variables hold 9 and 7. Print their sum.

Variables
Beginner

Multiply 9 by 7

Print the product of 9 and 7.

Variables

Math

41
Beginner

Age Calculator

Calculate age in days

Math
Beginner

Double the Number

Learn how to multiply numbers by 2 to double them.

Math
Beginner

Square Number

Learn how to square a number in Python.

Math
Beginner

Average Two Numbers

Learn how to calculate the average of two numbers using basic arithmetic.

Math
Beginner

Temperature Converter

Celsius to Fahrenheit

Math
Beginner

Circle Area

Calculate circle area

Math
Beginner

Rectangle Area

Calculate rectangle area

Math
Beginner

Triangle Area Calculation

Calculate the area of a triangle using the formula: Area = (base × height) ÷ 2

Math
Beginner

Minutes to Hours

Learn how to convert minutes into hours by using division.

Math
Beginner

Hours to Seconds

Convert hours to seconds

Math
Beginner

Shopping Total with Tax

Learn how to calculate the total price of an item after including tax.

Math
Beginner

Discount Price

Learn how to calculate a discount on a price using Python.

Math
Beginner

Cube Volume

Calculate cube volume

Math
Beginner

Speed Calculator

Learn how to calculate speed using the formula: speed = distance ÷ time.

Math
Beginner

BMI Calculator

Learn how to calculate the Body Mass Index (BMI)

Math
Beginner

Area of a 8×5 rectangle

Multiply width by height.

Math
Beginner

Area of a 12×7 rectangle

Multiply width by height.

Math
Beginner

Area of a 9×9 rectangle

Multiply width by height.

Math
Beginner

Area of a triangle (10 base, 6 height)

Triangle area is base*height/2.

Math
Beginner

Area of a triangle (7 base, 8 height)

Triangle area is base*height/2.

Math
Beginner

Area of a triangle (9 base, 4 height)

Triangle area is base*height/2.

Math
Beginner

Average of 5 numbers

Average is the sum divided by the count.

Math
Beginner

Average of 4 numbers

Average is the sum divided by the count.

Math
Beginner

Average of 6 numbers

Average is the sum divided by the count.

Math
Beginner

Largest of 7, 3, 9

max() returns the biggest value.

Math
Beginner

Largest of 12, 5, 8

max() returns the biggest value.

Math
Beginner

Largest of 4, 15, 6

max() returns the biggest value.

Math
Beginner

2 to the power of 5

The ** operator raises to a power.

Math
Beginner

3 to the power of 4

The ** operator raises to a power.

Math
Beginner

5 to the power of 3

The ** operator raises to a power.

Math
Beginner

Remainder of 17 ÷ 5

The % operator gives the remainder.

Math
Beginner

Remainder of 23 ÷ 7

The % operator gives the remainder.

Math
Beginner

Remainder of 40 ÷ 6 (Math)

The % operator gives the remainder.

Math
Beginner

Whole part of 17 ÷ 5

// keeps only the whole part of a division.

Math
Beginner

Whole part of 29 ÷ 4

// keeps only the whole part of a division.

Math
Beginner

Whole part of 50 ÷ 8

// keeps only the whole part of a division.

Math
Beginner

Sum from 1 to 10

sum(range(1, n+1)) adds the first n numbers.

Math
Beginner

Sum from 1 to 7

sum(range(1, n+1)) adds the first n numbers.

Math
Beginner

Sum from 1 to 100

sum(range(1, n+1)) adds the first n numbers.

Math
Beginner

Convert 25°C to Fahrenheit

F = C * 9/5 + 32.

Math
Beginner

Convert 37°C to Fahrenheit

F = C * 9/5 + 32.

Math

OOP

73
Advanced

Classes - Basic

Create your first class

OOP
Advanced

Class Methods

Add methods to classes

OOP
Advanced

BankAccount balance after deposits

Build a BankAccount (start 0) with a deposit method, deposit each of [100, 50, 25], and print the balance.

OOP
Advanced

Rectangle area via a class (3×4)

Write a Rectangle class with an area() method. Print the area of a 3×4 rectangle.

OOP
Advanced

Add two vectors with __add__

Give a Vector class an __add__ method. Print (3,4) + (1,2) as a tuple-like result.

OOP
Advanced

Inheritance and polymorphism

Animal has speak(). Make Dog say 'Woof' and Cat say 'Meow'. Loop and print each.

OOP
Advanced

Counter class bumped 5 times

Write a Counter class with bump(). Bump it 5 times and print its value.

OOP
Advanced

Custom __len__ on a Bag

Give a Bag class __len__. Fill it with [100, 50, 25] and print len(bag).

OOP
Advanced

Stack push/pop

Write a Stack with push and pop. Push each of [100, 50, 25], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([10, 20, 30, 40])

Build a BankAccount (start 0) with a deposit method, deposit each of [10, 20, 30, 40], and print the balance.

OOP
Advanced

Rectangle area via a class (5×6)

Write a Rectangle class with an area() method. Print the area of a 5×6 rectangle.

OOP
Advanced

Add two vectors with __add__ ([10, 20, 30, 40])

Give a Vector class an __add__ method. Print (5,6) + (7,8) as a tuple-like result.

OOP
Advanced

Counter class bumped 3 times

Write a Counter class with bump(). Bump it 3 times and print its value.

OOP
Advanced

Custom __len__ on a Bag ([10, 20, 30, 40])

Give a Bag class __len__. Fill it with [10, 20, 30, 40] and print len(bag).

OOP
Advanced

Stack push/pop ([10, 20, 30, 40])

Write a Stack with push and pop. Push each of [10, 20, 30, 40], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([7, 7, 7])

Build a BankAccount (start 0) with a deposit method, deposit each of [7, 7, 7], and print the balance.

OOP
Advanced

Rectangle area via a class (2×9)

Write a Rectangle class with an area() method. Print the area of a 2×9 rectangle.

OOP
Advanced

Add two vectors with __add__ ([7, 7, 7])

Give a Vector class an __add__ method. Print (2,9) + (4,1) as a tuple-like result.

OOP
Advanced

Counter class bumped 8 times

Write a Counter class with bump(). Bump it 8 times and print its value.

OOP
Advanced

Custom __len__ on a Bag ([7, 7, 7])

Give a Bag class __len__. Fill it with [7, 7, 7] and print len(bag).

OOP
Advanced

Stack push/pop ([7, 7, 7])

Write a Stack with push and pop. Push each of [7, 7, 7], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([12, 8])

Build a BankAccount (start 0) with a deposit method, deposit each of [12, 8], and print the balance.

OOP
Advanced

Rectangle area via a class (6×3)

Write a Rectangle class with an area() method. Print the area of a 6×3 rectangle.

OOP
Advanced

Add two vectors with __add__ ([12, 8])

Give a Vector class an __add__ method. Print (6,3) + (2,5) as a tuple-like result.

OOP
Advanced

Counter class bumped 4 times

Write a Counter class with bump(). Bump it 4 times and print its value.

OOP
Advanced

Custom __len__ on a Bag ([12, 8])

Give a Bag class __len__. Fill it with [12, 8] and print len(bag).

OOP
Advanced

Stack push/pop ([12, 8])

Write a Stack with push and pop. Push each of [12, 8], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([5, 5, 5, 5])

Build a BankAccount (start 0) with a deposit method, deposit each of [5, 5, 5, 5], and print the balance.

OOP
Advanced

Rectangle area via a class (8×2)

Write a Rectangle class with an area() method. Print the area of a 8×2 rectangle.

OOP
Advanced

Add two vectors with __add__ ([5, 5, 5, 5])

Give a Vector class an __add__ method. Print (8,2) + (1,9) as a tuple-like result.

OOP
Advanced

Counter class bumped 6 times

Write a Counter class with bump(). Bump it 6 times and print its value.

OOP
Advanced

Custom __len__ on a Bag ([5, 5, 5, 5])

Give a Bag class __len__. Fill it with [5, 5, 5, 5] and print len(bag).

OOP
Advanced

Stack push/pop ([5, 5, 5, 5])

Write a Stack with push and pop. Push each of [5, 5, 5, 5], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([101, 51, 26])

Build a BankAccount (start 0) with a deposit method, deposit each of [101, 51, 26], and print the balance.

OOP
Advanced

Rectangle area via a class (4×5)

Write a Rectangle class with an area() method. Print the area of a 4×5 rectangle.

OOP
Advanced

Add two vectors with __add__ ([101, 51, 26])

Give a Vector class an __add__ method. Print (4,5) + (2,3) as a tuple-like result.

OOP
Advanced

Custom __len__ on a Bag ([101, 51, 26])

Give a Bag class __len__. Fill it with [101, 51, 26] and print len(bag).

OOP
Advanced

Stack push/pop ([101, 51, 26])

Write a Stack with push and pop. Push each of [101, 51, 26], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([11, 21, 31, 41])

Build a BankAccount (start 0) with a deposit method, deposit each of [11, 21, 31, 41], and print the balance.

OOP
Advanced

Rectangle area via a class (6×7)

Write a Rectangle class with an area() method. Print the area of a 6×7 rectangle.

OOP
Advanced

Add two vectors with __add__ ([11, 21, 31, 41])

Give a Vector class an __add__ method. Print (6,7) + (8,9) as a tuple-like result.

OOP
Advanced

Custom __len__ on a Bag ([11, 21, 31, 41])

Give a Bag class __len__. Fill it with [11, 21, 31, 41] and print len(bag).

OOP
Advanced

Stack push/pop ([11, 21, 31, 41])

Write a Stack with push and pop. Push each of [11, 21, 31, 41], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([8, 8, 8])

Build a BankAccount (start 0) with a deposit method, deposit each of [8, 8, 8], and print the balance.

OOP
Advanced

Rectangle area via a class (3×10)

Write a Rectangle class with an area() method. Print the area of a 3×10 rectangle.

OOP
Advanced

Add two vectors with __add__ ([8, 8, 8])

Give a Vector class an __add__ method. Print (3,10) + (5,2) as a tuple-like result.

OOP
Advanced

Counter class bumped 9 times

Write a Counter class with bump(). Bump it 9 times and print its value.

OOP
Advanced

Custom __len__ on a Bag ([8, 8, 8])

Give a Bag class __len__. Fill it with [8, 8, 8] and print len(bag).

OOP
Advanced

Stack push/pop ([8, 8, 8])

Write a Stack with push and pop. Push each of [8, 8, 8], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([13, 9])

Build a BankAccount (start 0) with a deposit method, deposit each of [13, 9], and print the balance.

OOP
Advanced

Rectangle area via a class (7×4)

Write a Rectangle class with an area() method. Print the area of a 7×4 rectangle.

OOP
Advanced

Add two vectors with __add__ ([13, 9])

Give a Vector class an __add__ method. Print (7,4) + (3,6) as a tuple-like result.

OOP
Advanced

Custom __len__ on a Bag ([13, 9])

Give a Bag class __len__. Fill it with [13, 9] and print len(bag).

OOP
Advanced

Stack push/pop ([13, 9])

Write a Stack with push and pop. Push each of [13, 9], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([6, 6, 6, 6])

Build a BankAccount (start 0) with a deposit method, deposit each of [6, 6, 6, 6], and print the balance.

OOP
Advanced

Rectangle area via a class (9×3)

Write a Rectangle class with an area() method. Print the area of a 9×3 rectangle.

OOP
Advanced

Add two vectors with __add__ ([6, 6, 6, 6])

Give a Vector class an __add__ method. Print (9,3) + (2,10) as a tuple-like result.

OOP
Advanced

Counter class bumped 7 times

Write a Counter class with bump(). Bump it 7 times and print its value.

OOP
Advanced

Custom __len__ on a Bag ([6, 6, 6, 6])

Give a Bag class __len__. Fill it with [6, 6, 6, 6] and print len(bag).

OOP
Advanced

Stack push/pop ([6, 6, 6, 6])

Write a Stack with push and pop. Push each of [6, 6, 6, 6], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([102, 52, 27])

Build a BankAccount (start 0) with a deposit method, deposit each of [102, 52, 27], and print the balance.

OOP
Advanced

Add two vectors with __add__ ([102, 52, 27])

Give a Vector class an __add__ method. Print (5,6) + (3,4) as a tuple-like result.

OOP
Advanced

Custom __len__ on a Bag ([102, 52, 27])

Give a Bag class __len__. Fill it with [102, 52, 27] and print len(bag).

OOP
Advanced

Stack push/pop ([102, 52, 27])

Write a Stack with push and pop. Push each of [102, 52, 27], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([12, 22, 32, 42])

Build a BankAccount (start 0) with a deposit method, deposit each of [12, 22, 32, 42], and print the balance.

OOP
Advanced

Rectangle area via a class (7×8)

Write a Rectangle class with an area() method. Print the area of a 7×8 rectangle.

OOP
Advanced

Add two vectors with __add__ ([12, 22, 32, 42])

Give a Vector class an __add__ method. Print (7,8) + (9,10) as a tuple-like result.

OOP
Advanced

Custom __len__ on a Bag ([12, 22, 32, 42])

Give a Bag class __len__. Fill it with [12, 22, 32, 42] and print len(bag).

OOP
Advanced

Stack push/pop ([12, 22, 32, 42])

Write a Stack with push and pop. Push each of [12, 22, 32, 42], pop once, and print the value popped.

OOP
Advanced

BankAccount balance after deposits ([9, 9, 9])

Build a BankAccount (start 0) with a deposit method, deposit each of [9, 9, 9], and print the balance.

OOP
Advanced

Rectangle area via a class (4×11)

Write a Rectangle class with an area() method. Print the area of a 4×11 rectangle.

OOP
Advanced

Add two vectors with __add__ ([9, 9, 9])

Give a Vector class an __add__ method. Print (4,11) + (6,3) as a tuple-like result.

OOP
Advanced

Counter class bumped 10 times

Write a Counter class with bump(). Bump it 10 times and print its value.

OOP

Practice

76
Beginner

Is 'level' a palindrome?

Print True if 'level' equals its reverse, else False.

Practice
Beginner

Sum the digits of 12

Print the sum of the digits of 12.

Practice
Beginner

Smallest in [5, 2, 9, 1]

Print the smallest number in [5, 2, 9, 1].

Practice
Beginner

Count letters in 'hello world'

Print how many non-space characters are in 'hello world'.

Practice
Beginner

Largest in [5, 2, 9, 1]

Print the largest number in [5, 2, 9, 1].

Practice
Beginner

Is 'radar' a palindrome?

Print True if 'radar' equals its reverse, else False.

Practice
Beginner

Sum the digits of 45

Print the sum of the digits of 45.

Practice
Beginner

Smallest in [8, 8, 3]

Print the smallest number in [8, 8, 3].

Practice
Beginner

Count letters in 'keep it simple'

Print how many non-space characters are in 'keep it simple'.

Practice
Beginner

Largest in [8, 8, 3]

Print the largest number in [8, 8, 3].

Practice
Beginner

Is 'noon' a palindrome?

Print True if 'noon' equals its reverse, else False.

Practice
Beginner

Sum the digits of 90

Print the sum of the digits of 90.

Practice
Beginner

Smallest in [10, 4, 20, 7]

Print the smallest number in [10, 4, 20, 7].

Practice
Beginner

Count letters in 'data driven'

Print how many non-space characters are in 'data driven'.

Practice
Beginner

Largest in [10, 4, 20, 7]

Print the largest number in [10, 4, 20, 7].

Practice
Beginner

Is 'python' a palindrome?

Print True if 'python' equals its reverse, else False.

Practice
Beginner

Sum the digits of 7

Print the sum of the digits of 7.

Practice
Beginner

Smallest in [3, 6, 1, 9]

Print the smallest number in [3, 6, 1, 9].

Practice
Beginner

Count letters in 'clean code'

Print how many non-space characters are in 'clean code'.

Practice
Beginner

Largest in [3, 6, 1, 9]

Print the largest number in [3, 6, 1, 9].

Practice
Beginner

Is 'stats' a palindrome?

Print True if 'stats' equals its reverse, else False.

Practice
Beginner

Sum the digits of 38

Print the sum of the digits of 38.

Practice
Beginner

Smallest in [15, 2, 8]

Print the smallest number in [15, 2, 8].

Practice
Beginner

Count letters in 'open source'

Print how many non-space characters are in 'open source'.

Practice
Beginner

Largest in [15, 2, 8]

Print the largest number in [15, 2, 8].

Practice
Beginner

Is 'kayak' a palindrome?

Print True if 'kayak' equals its reverse, else False.

Practice
Intermediate

Fibonacci number #7

Print the 7th Fibonacci number (0,1,1,2,...). Use a loop.

Practice
Intermediate

Is 13 prime?

Print True if 13 is prime, else False.

Practice
Intermediate

GCD of 12 and 8

Print the greatest common divisor of 12 and 8.

Practice
Intermediate

Count vowels in 'education'

Print how many vowels are in 'education'.

Practice
Intermediate

Reverse the words of a sentence

Print the words of 'the cat sat' in reverse order, space-separated.

Practice
Intermediate

Sum of multiples of 3 under 13

Print the sum of all multiples of 3 below 13.

Practice
Intermediate

Fibonacci number #10

Print the 10th Fibonacci number (0,1,1,2,...). Use a loop.

Practice
Intermediate

Is 17 prime?

Print True if 17 is prime, else False.

Practice
Intermediate

GCD of 18 and 24

Print the greatest common divisor of 18 and 24.

Practice
Intermediate

Count vowels in 'mountain'

Print how many vowels are in 'mountain'.

Practice
Intermediate

Reverse the words of a sentence (10)

Print the words of 'keep moving forward' in reverse order, space-separated.

Practice
Intermediate

Sum of multiples of 5 under 17

Print the sum of all multiples of 5 below 17.

Practice
Intermediate

Fibonacci number #8

Print the 8th Fibonacci number (0,1,1,2,...). Use a loop.

Practice
Intermediate

Is 29 prime?

Print True if 29 is prime, else False.

Practice
Intermediate

GCD of 40 and 16

Print the greatest common divisor of 40 and 16.

Practice
Intermediate

Count vowels in 'keyboard'

Print how many vowels are in 'keyboard'.

Practice
Intermediate

Reverse the words of a sentence (8)

Print the words of 'python is fun' in reverse order, space-separated.

Practice
Intermediate

Sum of multiples of 4 under 29

Print the sum of all multiples of 4 below 29.

Practice
Intermediate

Fibonacci number #12

Print the 12th Fibonacci number (0,1,1,2,...). Use a loop.

Practice
Intermediate

Is 7 prime?

Print True if 7 is prime, else False.

Practice
Intermediate

GCD of 9 and 6

Print the greatest common divisor of 9 and 6.

Practice
Intermediate

Count vowels in 'yesterday'

Print how many vowels are in 'yesterday'.

Practice
Intermediate

Reverse the words of a sentence (12)

Print the words of 'data never sleeps' in reverse order, space-separated.

Practice
Intermediate

Sum of multiples of 2 under 7

Print the sum of all multiples of 2 below 7.

Practice
Intermediate

Fibonacci number #6

Print the 6th Fibonacci number (0,1,1,2,...). Use a loop.

Practice
Intermediate

Is 91 prime?

Print True if 91 is prime, else False.

Practice
Intermediate

GCD of 21 and 14

Print the greatest common divisor of 21 and 14.

Practice
Intermediate

Count vowels in 'strawberry'

Print how many vowels are in 'strawberry'.

Practice
Intermediate

Reverse the words of a sentence (6)

Print the words of 'read more code' in reverse order, space-separated.

Practice
Intermediate

Sum of multiples of 7 under 91

Print the sum of all multiples of 7 below 91.

Practice
Intermediate

Fibonacci number #9

Print the 9th Fibonacci number (0,1,1,2,...). Use a loop.

Practice
Intermediate

Is 50 prime?

Print True if 50 is prime, else False.

Practice
Intermediate

GCD of 100 and 35

Print the greatest common divisor of 100 and 35.

Practice
Intermediate

Count vowels in 'umbrella'

Print how many vowels are in 'umbrella'.

Practice
Intermediate

Reverse the words of a sentence (9)

Print the words of 'one step today' in reverse order, space-separated.

Practice
Intermediate

Sum of multiples of 10 under 50

Print the sum of all multiples of 10 below 50.

Practice
Intermediate

Is 20 prime?

Print True if 20 is prime, else False.

Practice
Intermediate

GCD of 19 and 9

Print the greatest common divisor of 19 and 9.

Practice
Intermediate

Sum of multiples of 4 under 20

Print the sum of all multiples of 4 below 20.

Practice
Intermediate

Fibonacci number #17

Print the 17th Fibonacci number (0,1,1,2,...). Use a loop.

Practice
Intermediate

Is 24 prime?

Print True if 24 is prime, else False.

Practice
Intermediate

GCD of 25 and 31

Print the greatest common divisor of 25 and 31.

Practice
Intermediate

Sum of multiples of 6 under 24

Print the sum of all multiples of 6 below 24.

Practice
Intermediate

Is 36 prime?

Print True if 36 is prime, else False.

Practice
Intermediate

GCD of 47 and 23

Print the greatest common divisor of 47 and 23.

Practice
Intermediate

Sum of multiples of 5 under 36

Print the sum of all multiples of 5 below 36.

Practice
Intermediate

Fibonacci number #19

Print the 19th Fibonacci number (0,1,1,2,...). Use a loop.

Practice
Intermediate

Is 8 prime?

Print True if 8 is prime, else False.

Practice
Intermediate

GCD of 10 and 7

Print the greatest common divisor of 10 and 7.

Practice
Intermediate

Sum of multiples of 3 under 8

Print the sum of all multiples of 3 below 8.

Practice

Loops

50
Intermediate

Sum of even numbers up to 20

Add every even number from 1 to 20 and print the total.

Loops
Intermediate

Sum the squares to 20

Print the sum of the squares of 1 to 20.

Loops
Intermediate

Product of 1 to 20

Multiply every number from 1 to 20 and print the product.

Loops
Intermediate

Count items over 5

In the list [5, 12, 7, 20, 3], count how many values are greater than 5 and print the count.

Loops
Intermediate

Multiplication row for 3

Print 3×1 through 3×5, one product per line.

Loops
Intermediate

Countdown from 20 by 3

Using a while loop, print 20, then keep subtracting 3 and printing until the value is below 1.

Loops
Intermediate

Sum a list of 5 numbers

Loop over [5, 12, 7, 20, 3] and print the running total only at the end.

Loops
Intermediate

Sum of even numbers up to 10

Add every even number from 1 to 10 and print the total.

Loops
Intermediate

Sum the squares to 10

Print the sum of the squares of 1 to 10.

Loops
Intermediate

Product of 1 to 10

Multiply every number from 1 to 10 and print the product.

Loops
Intermediate

Count items over 10

In the list [1, 9, 4, 8, 2], count how many values are greater than 10 and print the count.

Loops
Intermediate

Multiplication row for 4

Print 4×1 through 4×5, one product per line.

Loops
Intermediate

Countdown from 10 by 2

Using a while loop, print 10, then keep subtracting 2 and printing until the value is below 1.

Loops
Intermediate

Sum a list of 5 numbers ([1, 9, 4, 8, 2])

Loop over [1, 9, 4, 8, 2] and print the running total only at the end.

Loops
Intermediate

Sum of even numbers up to 50

Add every even number from 1 to 50 and print the total.

Loops
Intermediate

Sum the squares to 50

Print the sum of the squares of 1 to 50.

Loops
Intermediate

Product of 1 to 50

Multiply every number from 1 to 50 and print the product.

Loops
Intermediate

Count items over 15

In the list [30, 10, 40, 20], count how many values are greater than 15 and print the count.

Loops
Intermediate

Multiplication row for 6

Print 6×1 through 6×5, one product per line.

Loops
Intermediate

Countdown from 50 by 5

Using a while loop, print 50, then keep subtracting 5 and printing until the value is below 1.

Loops
Intermediate

Sum a list of 4 numbers

Loop over [30, 10, 40, 20] and print the running total only at the end.

Loops
Intermediate

Sum of even numbers up to 15

Add every even number from 1 to 15 and print the total.

Loops
Intermediate

Sum the squares to 15

Print the sum of the squares of 1 to 15.

Loops
Intermediate

Product of 1 to 15

Multiply every number from 1 to 15 and print the product.

Loops
Intermediate

Count items over 7

In the list [7, 7, 8, 2, 11], count how many values are greater than 7 and print the count.

Loops
Intermediate

Multiplication row for 7

Print 7×1 through 7×5, one product per line.

Loops
Intermediate

Countdown from 15 by 3

Using a while loop, print 15, then keep subtracting 3 and printing until the value is below 1.

Loops
Intermediate

Sum a list of 5 numbers ([7, 7, 8, 2, 11])

Loop over [7, 7, 8, 2, 11] and print the running total only at the end.

Loops
Intermediate

Sum of even numbers up to 30

Add every even number from 1 to 30 and print the total.

Loops
Intermediate

Sum the squares to 30

Print the sum of the squares of 1 to 30.

Loops
Intermediate

Product of 1 to 30

Multiply every number from 1 to 30 and print the product.

Loops
Intermediate

Count items over 20

In the list [100, 50, 25], count how many values are greater than 20 and print the count.

Loops
Intermediate

Multiplication row for 9

Print 9×1 through 9×5, one product per line.

Loops
Intermediate

Countdown from 30 by 4

Using a while loop, print 30, then keep subtracting 4 and printing until the value is below 1.

Loops
Intermediate

Sum a list of 3 numbers

Loop over [100, 50, 25] and print the running total only at the end.

Loops
Intermediate

Sum of even numbers up to 8

Add every even number from 1 to 8 and print the total.

Loops
Intermediate

Sum the squares to 8

Print the sum of the squares of 1 to 8.

Loops
Intermediate

Product of 1 to 8

Multiply every number from 1 to 8 and print the product.

Loops
Intermediate

Count items over 3

In the list [3, 6, 9, 12, 15], count how many values are greater than 3 and print the count.

Loops
Intermediate

Multiplication row for 2

Print 2×1 through 2×5, one product per line.

Loops
Intermediate

Countdown from 8 by 1

Using a while loop, print 8, then keep subtracting 1 and printing until the value is below 1.

Loops
Intermediate

Sum a list of 5 numbers ([3, 6, 9, 12, 15])

Loop over [3, 6, 9, 12, 15] and print the running total only at the end.

Loops
Intermediate

Sum of even numbers up to 12

Add every even number from 1 to 12 and print the total.

Loops
Intermediate

Sum the squares to 12

Print the sum of the squares of 1 to 12.

Loops
Intermediate

Product of 1 to 12

Multiply every number from 1 to 12 and print the product.

Loops
Intermediate

Count items over 25

In the list [8, 8, 8, 8], count how many values are greater than 25 and print the count.

Loops
Intermediate

Multiplication row for 5

Print 5×1 through 5×5, one product per line.

Loops
Intermediate

Countdown from 12 by 2

Using a while loop, print 12, then keep subtracting 2 and printing until the value is below 1.

Loops
Intermediate

Sum a list of 4 numbers ([8, 8, 8, 8])

Loop over [8, 8, 8, 8] and print the running total only at the end.

Loops
Intermediate

Sum of even numbers up to 100

Add every even number from 1 to 100 and print the total.

Loops

Algorithms

72
Advanced

Binary search for 23

Print the index of 23 in the sorted list [2, 5, 8, 12, 16, 23, 38, 56] using binary search (or -1).

Algorithms
Advanced

Count 23 in a list

Without using .count(), loop through [4, 2, 7, 2, 9, 2] and print how many times 23 appears.

Algorithms
Advanced

Bubble sort [4, 2, 7, 2, 9, 2]

Implement bubble sort on [4, 2, 7, 2, 9, 2] and print the sorted list.

Algorithms
Advanced

Digit sum of 4827

Print the sum of the digits of 4827 using a loop (no str trick required).

Algorithms
Advanced

Reverse the number 4827

Print 4827 with its digits reversed (as an integer).

Algorithms
Advanced

GCD of 48 and 36 (Euclid)

Implement Euclid's algorithm to print gcd(48, 36).

Algorithms
Advanced

Count primes below 30

Print how many prime numbers are below 30.

Algorithms
Advanced

Maximum subarray sum

Print the largest sum of any contiguous run in [-2, 1, -3, 4, -1, 2, 1, -5, 4] (Kadane's algorithm).

Algorithms
Advanced

Binary search for 16

Print the index of 16 in the sorted list [1, 4, 9, 16, 25, 36] using binary search (or -1).

Algorithms
Advanced

Count 16 in a list

Without using .count(), loop through [5, 5, 1, 5, 3] and print how many times 16 appears.

Algorithms
Advanced

Bubble sort [5, 5, 1, 5, 3]

Implement bubble sort on [5, 5, 1, 5, 3] and print the sorted list.

Algorithms
Advanced

Digit sum of 915

Print the sum of the digits of 915 using a loop (no str trick required).

Algorithms
Advanced

Reverse the number 915

Print 915 with its digits reversed (as an integer).

Algorithms
Advanced

GCD of 54 and 24 (Euclid)

Implement Euclid's algorithm to print gcd(54, 24).

Algorithms
Advanced

Count primes below 20

Print how many prime numbers are below 20.

Algorithms
Advanced

Maximum subarray sum ([1, 4, 9, 16, 25, 36])

Print the largest sum of any contiguous run in [1, -2, 3, 4, -1] (Kadane's algorithm).

Algorithms
Advanced

Binary search for 40

Print the index of 40 in the sorted list [10, 20, 30, 40, 50] using binary search (or -1).

Algorithms
Advanced

Count 40 in a list

Without using .count(), loop through [8, 1, 8, 8, 2, 8] and print how many times 40 appears.

Algorithms
Advanced

Bubble sort [8, 1, 8, 8, 2, 8]

Implement bubble sort on [8, 1, 8, 8, 2, 8] and print the sorted list.

Algorithms
Advanced

Digit sum of 3406

Print the sum of the digits of 3406 using a loop (no str trick required).

Algorithms
Advanced

Reverse the number 3406

Print 3406 with its digits reversed (as an integer).

Algorithms
Advanced

GCD of 21 and 14 (Euclid)

Implement Euclid's algorithm to print gcd(21, 14).

Algorithms
Advanced

Count primes below 50

Print how many prime numbers are below 50.

Algorithms
Advanced

Maximum subarray sum ([10, 20, 30, 40, 50])

Print the largest sum of any contiguous run in [-1, -2, -3, 4, 5] (Kadane's algorithm).

Algorithms
Advanced

Binary search for 7

Print the index of 7 in the sorted list [3, 7, 11, 15, 19] using binary search (or -1).

Algorithms
Advanced

Count 7 in a list

Without using .count(), loop through [6, 6, 6, 1] and print how many times 7 appears.

Algorithms
Advanced

Bubble sort [6, 6, 6, 1]

Implement bubble sort on [6, 6, 6, 1] and print the sorted list.

Algorithms
Advanced

Digit sum of 762

Print the sum of the digits of 762 using a loop (no str trick required).

Algorithms
Advanced

Reverse the number 762

Print 762 with its digits reversed (as an integer).

Algorithms
Advanced

GCD of 100 and 35 (Euclid)

Implement Euclid's algorithm to print gcd(100, 35).

Algorithms
Advanced

Count primes below 40

Print how many prime numbers are below 40.

Algorithms
Advanced

Maximum subarray sum ([3, 7, 11, 15, 19])

Print the largest sum of any contiguous run in [2, -1, 2, -1, 3] (Kadane's algorithm).

Algorithms
Advanced

Binary search for 91

Print the index of 91 in the sorted list [12, 34, 56, 78, 91] using binary search (or -1).

Algorithms
Advanced

Count 91 in a list

Without using .count(), loop through [9, 2, 9, 4, 9] and print how many times 91 appears.

Algorithms
Advanced

Bubble sort [9, 2, 9, 4, 9]

Implement bubble sort on [9, 2, 9, 4, 9] and print the sorted list.

Algorithms
Advanced

Digit sum of 1234

Print the sum of the digits of 1234 using a loop (no str trick required).

Algorithms
Advanced

Reverse the number 1234

Print 1234 with its digits reversed (as an integer).

Algorithms
Advanced

GCD of 81 and 27 (Euclid)

Implement Euclid's algorithm to print gcd(81, 27).

Algorithms
Advanced

Count primes below 15

Print how many prime numbers are below 15.

Algorithms
Advanced

Maximum subarray sum ([12, 34, 56, 78, 91])

Print the largest sum of any contiguous run in [4, -3, 5, -2, 1] (Kadane's algorithm).

Algorithms
Advanced

Binary search for 30

Print the index of 30 in the sorted list [3, 6, 9, 13, 17, 24, 39, 57] using binary search (or -1).

Algorithms
Advanced

Count 30 in a list

Without using .count(), loop through [5, 3, 8, 3, 10, 3] and print how many times 30 appears.

Algorithms
Advanced

Bubble sort [5, 3, 8, 3, 10, 3]

Implement bubble sort on [5, 3, 8, 3, 10, 3] and print the sorted list.

Algorithms
Advanced

Digit sum of 4834

Print the sum of the digits of 4834 using a loop (no str trick required).

Algorithms
Advanced

Reverse the number 4834

Print 4834 with its digits reversed (as an integer).

Algorithms
Advanced

GCD of 55 and 43 (Euclid)

Implement Euclid's algorithm to print gcd(55, 43).

Algorithms
Advanced

Count primes below 37

Print how many prime numbers are below 37.

Algorithms
Advanced

Maximum subarray sum ([3, 6, 9, 13, 17, 24, 39, 57])

Print the largest sum of any contiguous run in [-1, 2, -2, 5, 0, 3, 2, -4, 5] (Kadane's algorithm).

Algorithms
Advanced

Binary search for 23 ([2, 5, 10, 17, 26, 37])

Print the index of 23 in the sorted list [2, 5, 10, 17, 26, 37] using binary search (or -1).

Algorithms
Advanced

Count 23 in a list ([2, 5, 10, 17, 26, 37])

Without using .count(), loop through [6, 6, 2, 6, 4] and print how many times 23 appears.

Algorithms
Advanced

Bubble sort [6, 6, 2, 6, 4]

Implement bubble sort on [6, 6, 2, 6, 4] and print the sorted list.

Algorithms
Advanced

Digit sum of 922

Print the sum of the digits of 922 using a loop (no str trick required).

Algorithms
Advanced

Reverse the number 922

Print 922 with its digits reversed (as an integer).

Algorithms
Advanced

GCD of 61 and 31 (Euclid)

Implement Euclid's algorithm to print gcd(61, 31).

Algorithms
Advanced

Count primes below 27

Print how many prime numbers are below 27.

Algorithms
Advanced

Maximum subarray sum ([2, 5, 10, 17, 26, 37])

Print the largest sum of any contiguous run in [2, -1, 4, 5, 0] (Kadane's algorithm).

Algorithms
Advanced

Binary search for 47

Print the index of 47 in the sorted list [11, 21, 31, 41, 51] using binary search (or -1).

Algorithms
Advanced

Count 47 in a list

Without using .count(), loop through [9, 2, 9, 9, 3, 9] and print how many times 47 appears.

Algorithms
Advanced

Bubble sort [9, 2, 9, 9, 3, 9]

Implement bubble sort on [9, 2, 9, 9, 3, 9] and print the sorted list.

Algorithms
Advanced

Digit sum of 3413

Print the sum of the digits of 3413 using a loop (no str trick required).

Algorithms
Advanced

Reverse the number 3413

Print 3413 with its digits reversed (as an integer).

Algorithms
Advanced

GCD of 28 and 21 (Euclid)

Implement Euclid's algorithm to print gcd(28, 21).

Algorithms
Advanced

Count primes below 57

Print how many prime numbers are below 57.

Algorithms
Advanced

Maximum subarray sum ([11, 21, 31, 41, 51])

Print the largest sum of any contiguous run in [0, -1, -2, 5, 6] (Kadane's algorithm).

Algorithms
Advanced

Binary search for 8

Print the index of 8 in the sorted list [4, 8, 12, 16, 20] using binary search (or -1).

Algorithms
Advanced

Count 8 in a list

Without using .count(), loop through [7, 7, 7, 2] and print how many times 8 appears.

Algorithms
Advanced

Bubble sort [7, 7, 7, 2]

Implement bubble sort on [7, 7, 7, 2] and print the sorted list.

Algorithms
Advanced

Digit sum of 769

Print the sum of the digits of 769 using a loop (no str trick required).

Algorithms
Advanced

Reverse the number 769

Print 769 with its digits reversed (as an integer).

Algorithms
Advanced

GCD of 107 and 42 (Euclid)

Implement Euclid's algorithm to print gcd(107, 42).

Algorithms
Advanced

Count primes below 47

Print how many prime numbers are below 47.

Algorithms
Advanced

Maximum subarray sum ([4, 8, 12, 16, 20])

Print the largest sum of any contiguous run in [3, 0, 3, 0, 4] (Kadane's algorithm).

Algorithms

Data Analysis

72
Advanced

Mean of a 6-value dataset

Print the mean of [4, 8, 15, 16, 23, 42] rounded to 2 decimals.

Data Analysis
Advanced

Median of a dataset

Print the median of [4, 8, 15, 16, 23, 42].

Data Analysis
Advanced

Most common value (mode)

Print the mode (most frequent value) of [2, 3, 3, 3, 5, 2].

Data Analysis
Advanced

Range (max − min)

Print the range (max minus min) of [4, 8, 15, 16, 23, 42].

Data Analysis
Advanced

Count values above 15

Print how many values in [4, 8, 15, 16, 23, 42] are greater than 15.

Data Analysis
Advanced

Population standard deviation

Print the population standard deviation of [4, 8, 15, 16, 23, 42] rounded to 2 decimals.

Data Analysis
Advanced

Top 3 highest values

Print the 3 largest values of [4, 8, 15, 16, 23, 42] in descending order.

Data Analysis
Advanced

Sum of the even values

Print the sum of only the even numbers in [4, 8, 15, 16, 23, 42].

Data Analysis
Advanced

Mean of a 4-value dataset

Print the mean of [10, 20, 30, 40] rounded to 2 decimals.

Data Analysis
Advanced

Median of a dataset ([10, 20, 30, 40])

Print the median of [10, 20, 30, 40].

Data Analysis
Advanced

Most common value (mode) ([10, 20, 30, 40])

Print the mode (most frequent value) of [7, 7, 1, 7, 9].

Data Analysis
Advanced

Range (max − min) ([10, 20, 30, 40])

Print the range (max minus min) of [10, 20, 30, 40].

Data Analysis
Advanced

Count values above 25

Print how many values in [10, 20, 30, 40] are greater than 25.

Data Analysis
Advanced

Population standard deviation ([10, 20, 30, 40])

Print the population standard deviation of [10, 20, 30, 40] rounded to 2 decimals.

Data Analysis
Advanced

Top 3 highest values ([10, 20, 30, 40])

Print the 3 largest values of [10, 20, 30, 40] in descending order.

Data Analysis
Advanced

Sum of the even values ([10, 20, 30, 40])

Print the sum of only the even numbers in [10, 20, 30, 40].

Data Analysis
Advanced

Mean of a 7-value dataset

Print the mean of [5, 9, 1, 7, 3, 8, 2] rounded to 2 decimals.

Data Analysis
Advanced

Median of a dataset ([5, 9, 1, 7, 3, 8, 2])

Print the median of [5, 9, 1, 7, 3, 8, 2].

Data Analysis
Advanced

Most common value (mode) ([5, 9, 1, 7, 3, 8, 2])

Print the mode (most frequent value) of [4, 4, 4, 1, 2].

Data Analysis
Advanced

Range (max − min) ([5, 9, 1, 7, 3, 8, 2])

Print the range (max minus min) of [5, 9, 1, 7, 3, 8, 2].

Data Analysis
Advanced

Count values above 4

Print how many values in [5, 9, 1, 7, 3, 8, 2] are greater than 4.

Data Analysis
Advanced

Population standard deviation ([5, 9, 1, 7, 3, 8, 2])

Print the population standard deviation of [5, 9, 1, 7, 3, 8, 2] rounded to 2 decimals.

Data Analysis
Advanced

Top 3 highest values ([5, 9, 1, 7, 3, 8, 2])

Print the 3 largest values of [5, 9, 1, 7, 3, 8, 2] in descending order.

Data Analysis
Advanced

Sum of the even values ([5, 9, 1, 7, 3, 8, 2])

Print the sum of only the even numbers in [5, 9, 1, 7, 3, 8, 2].

Data Analysis
Advanced

Mean of a 5-value dataset

Print the mean of [12, 18, 24, 30, 36] rounded to 2 decimals.

Data Analysis
Advanced

Median of a dataset ([12, 18, 24, 30, 36])

Print the median of [12, 18, 24, 30, 36].

Data Analysis
Advanced

Most common value (mode) ([12, 18, 24, 30, 36])

Print the mode (most frequent value) of [6, 6, 2, 6, 8, 6].

Data Analysis
Advanced

Range (max − min) ([12, 18, 24, 30, 36])

Print the range (max minus min) of [12, 18, 24, 30, 36].

Data Analysis
Advanced

Count values above 20

Print how many values in [12, 18, 24, 30, 36] are greater than 20.

Data Analysis
Advanced

Population standard deviation ([12, 18, 24, 30, 36])

Print the population standard deviation of [12, 18, 24, 30, 36] rounded to 2 decimals.

Data Analysis
Advanced

Top 3 highest values ([12, 18, 24, 30, 36])

Print the 3 largest values of [12, 18, 24, 30, 36] in descending order.

Data Analysis
Advanced

Sum of the even values ([12, 18, 24, 30, 36])

Print the sum of only the even numbers in [12, 18, 24, 30, 36].

Data Analysis
Advanced

Mean of a 7-value dataset ([3, 6, 9, 12, 15, 18, 21])

Print the mean of [3, 6, 9, 12, 15, 18, 21] rounded to 2 decimals.

Data Analysis
Advanced

Median of a dataset ([3, 6, 9, 12, 15, 18, 21])

Print the median of [3, 6, 9, 12, 15, 18, 21].

Data Analysis
Advanced

Most common value (mode) ([3, 6, 9, 12, 15, 18, 21])

Print the mode (most frequent value) of [1, 9, 9, 9, 3].

Data Analysis
Advanced

Range (max − min) ([3, 6, 9, 12, 15, 18, 21])

Print the range (max minus min) of [3, 6, 9, 12, 15, 18, 21].

Data Analysis
Advanced

Count values above 10

Print how many values in [3, 6, 9, 12, 15, 18, 21] are greater than 10.

Data Analysis
Advanced

Population standard deviation ([3, 6, 9, 12, 15, 18, 21])

Print the population standard deviation of [3, 6, 9, 12, 15, 18, 21] rounded to 2 decimals.

Data Analysis
Advanced

Top 3 highest values ([3, 6, 9, 12, 15, 18, 21])

Print the 3 largest values of [3, 6, 9, 12, 15, 18, 21] in descending order.

Data Analysis
Advanced

Sum of the even values ([3, 6, 9, 12, 15, 18, 21])

Print the sum of only the even numbers in [3, 6, 9, 12, 15, 18, 21].

Data Analysis
Advanced

Mean of a 6-value dataset ([5, 9, 16, 17, 24, 43])

Print the mean of [5, 9, 16, 17, 24, 43] rounded to 2 decimals.

Data Analysis
Advanced

Median of a dataset ([5, 9, 16, 17, 24, 43])

Print the median of [5, 9, 16, 17, 24, 43].

Data Analysis
Advanced

Most common value (mode) ([5, 9, 16, 17, 24, 43])

Print the mode (most frequent value) of [3, 4, 4, 4, 6, 3].

Data Analysis
Advanced

Range (max − min) ([5, 9, 16, 17, 24, 43])

Print the range (max minus min) of [5, 9, 16, 17, 24, 43].

Data Analysis
Advanced

Count values above 22

Print how many values in [5, 9, 16, 17, 24, 43] are greater than 22.

Data Analysis
Advanced

Population standard deviation ([5, 9, 16, 17, 24, 43])

Print the population standard deviation of [5, 9, 16, 17, 24, 43] rounded to 2 decimals.

Data Analysis
Advanced

Top 3 highest values ([5, 9, 16, 17, 24, 43])

Print the 3 largest values of [5, 9, 16, 17, 24, 43] in descending order.

Data Analysis
Advanced

Sum of the even values ([5, 9, 16, 17, 24, 43])

Print the sum of only the even numbers in [5, 9, 16, 17, 24, 43].

Data Analysis
Advanced

Mean of a 4-value dataset ([11, 21, 31, 41])

Print the mean of [11, 21, 31, 41] rounded to 2 decimals.

Data Analysis
Advanced

Median of a dataset ([11, 21, 31, 41])

Print the median of [11, 21, 31, 41].

Data Analysis
Advanced

Most common value (mode) ([11, 21, 31, 41])

Print the mode (most frequent value) of [8, 8, 2, 8, 10].

Data Analysis
Advanced

Range (max − min) ([11, 21, 31, 41])

Print the range (max minus min) of [11, 21, 31, 41].

Data Analysis
Advanced

Count values above 32

Print how many values in [11, 21, 31, 41] are greater than 32.

Data Analysis
Advanced

Population standard deviation ([11, 21, 31, 41])

Print the population standard deviation of [11, 21, 31, 41] rounded to 2 decimals.

Data Analysis
Advanced

Top 3 highest values ([11, 21, 31, 41])

Print the 3 largest values of [11, 21, 31, 41] in descending order.

Data Analysis
Advanced

Sum of the even values ([11, 21, 31, 41])

Print the sum of only the even numbers in [11, 21, 31, 41].

Data Analysis
Advanced

Mean of a 7-value dataset ([6, 10, 2, 8, 4, 9, 3])

Print the mean of [6, 10, 2, 8, 4, 9, 3] rounded to 2 decimals.

Data Analysis
Advanced

Median of a dataset ([6, 10, 2, 8, 4, 9, 3])

Print the median of [6, 10, 2, 8, 4, 9, 3].

Data Analysis
Advanced

Most common value (mode) ([6, 10, 2, 8, 4, 9, 3])

Print the mode (most frequent value) of [5, 5, 5, 2, 3].

Data Analysis
Advanced

Range (max − min) ([6, 10, 2, 8, 4, 9, 3])

Print the range (max minus min) of [6, 10, 2, 8, 4, 9, 3].

Data Analysis
Advanced

Count values above 5

Print how many values in [6, 10, 2, 8, 4, 9, 3] are greater than 5.

Data Analysis
Advanced

Population standard deviation ([6, 10, 2, 8, 4, 9, 3])

Print the population standard deviation of [6, 10, 2, 8, 4, 9, 3] rounded to 2 decimals.

Data Analysis
Advanced

Top 3 highest values ([6, 10, 2, 8, 4, 9, 3])

Print the 3 largest values of [6, 10, 2, 8, 4, 9, 3] in descending order.

Data Analysis
Advanced

Sum of the even values ([6, 10, 2, 8, 4, 9, 3])

Print the sum of only the even numbers in [6, 10, 2, 8, 4, 9, 3].

Data Analysis
Advanced

Mean of a 5-value dataset ([13, 19, 25, 31, 37])

Print the mean of [13, 19, 25, 31, 37] rounded to 2 decimals.

Data Analysis
Advanced

Median of a dataset ([13, 19, 25, 31, 37])

Print the median of [13, 19, 25, 31, 37].

Data Analysis
Advanced

Most common value (mode) ([13, 19, 25, 31, 37])

Print the mode (most frequent value) of [7, 7, 3, 7, 9, 7].

Data Analysis
Advanced

Range (max − min) ([13, 19, 25, 31, 37])

Print the range (max minus min) of [13, 19, 25, 31, 37].

Data Analysis
Advanced

Count values above 27

Print how many values in [13, 19, 25, 31, 37] are greater than 27.

Data Analysis
Advanced

Population standard deviation ([13, 19, 25, 31, 37])

Print the population standard deviation of [13, 19, 25, 31, 37] rounded to 2 decimals.

Data Analysis
Advanced

Top 3 highest values ([13, 19, 25, 31, 37])

Print the 3 largest values of [13, 19, 25, 31, 37] in descending order.

Data Analysis
Advanced

Sum of the even values ([13, 19, 25, 31, 37])

Print the sum of only the even numbers in [13, 19, 25, 31, 37].

Data Analysis

File Operations

72
Advanced

Count the lines of a text block

The text has 4 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line

Each line of the text holds a number. Print the total of [10, 20, 30].

File Operations
Advanced

Count words in a paragraph

Print how many words are in the text 'the quick brown fox jumps'.

File Operations
Advanced

Count lines containing 'INFO'

Print how many lines of the text contain 'INFO'.

File Operations
Advanced

Sum a CSV column

Parse the CSV with the csv module and print the sum of the 'qty' column.

File Operations
Advanced

Length of the longest line

Print the length of the longest line in the text.

File Operations
Advanced

Count the lines of a text block ([5, 5, 5, 5])

The text has 6 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line ([5, 5, 5, 5])

Each line of the text holds a number. Print the total of [5, 5, 5, 5].

File Operations
Advanced

Count words in a paragraph ([5, 5, 5, 5])

Print how many words are in the text 'data pipelines move records daily'.

File Operations
Advanced

Count lines containing 'load'

Print how many lines of the text contain 'load'.

File Operations
Advanced

Sum a CSV column ([5, 5, 5, 5])

Parse the CSV with the csv module and print the sum of the 'qty' column.

File Operations
Advanced

Length of the longest line ([5, 5, 5, 5])

Print the length of the longest line in the text.

File Operations
Advanced

Count the lines of a text block ([7, 1, 9, 2, 4])

The text has 3 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line ([7, 1, 9, 2, 4])

Each line of the text holds a number. Print the total of [7, 1, 9, 2, 4].

File Operations
Advanced

Count words in a paragraph ([7, 1, 9, 2, 4])

Print how many words are in the text 'clean code reads like prose'.

File Operations
Advanced

Count lines containing 'ping'

Print how many lines of the text contain 'ping'.

File Operations
Advanced

Sum a CSV column ([7, 1, 9, 2, 4])

Parse the CSV with the csv module and print the sum of the 'qty' column.

File Operations
Advanced

Length of the longest line ([7, 1, 9, 2, 4])

Print the length of the longest line in the text.

File Operations
Advanced

Count the lines of a text block ([100, 50, 25])

The text has 5 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line ([100, 50, 25])

Each line of the text holds a number. Print the total of [100, 50, 25].

File Operations
Advanced

Count words in a paragraph ([100, 50, 25])

Print how many words are in the text 'small steps build big systems'.

File Operations
Advanced

Count lines containing 'WARN'

Print how many lines of the text contain 'WARN'.

File Operations
Advanced

Sum a CSV column ([100, 50, 25])

Parse the CSV with the csv module and print the sum of the 'qty' column.

File Operations
Advanced

Length of the longest line ([100, 50, 25])

Print the length of the longest line in the text.

File Operations
Advanced

Count the lines of a text block ([2, 4, 6, 8])

The text has 7 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line ([2, 4, 6, 8])

Each line of the text holds a number. Print the total of [2, 4, 6, 8].

File Operations
Advanced

Count words in a paragraph ([2, 4, 6, 8])

Print how many words are in the text 'practice turns ideas into skill'.

File Operations
Advanced

Count lines containing 'read'

Print how many lines of the text contain 'read'.

File Operations
Advanced

Sum a CSV column ([2, 4, 6, 8])

Parse the CSV with the csv module and print the sum of the 'qty' column.

File Operations
Advanced

Length of the longest line ([2, 4, 6, 8])

Print the length of the longest line in the text.

File Operations
Advanced

Count the lines of a text block ([3, 3, 3, 3, 3])

The text has 8 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line ([3, 3, 3, 3, 3])

Each line of the text holds a number. Print the total of [3, 3, 3, 3, 3].

File Operations
Advanced

Count words in a paragraph ([3, 3, 3, 3, 3])

Print how many words are in the text 'logs reveal what really happened'.

File Operations
Advanced

Count lines containing 'ok'

Print how many lines of the text contain 'ok'.

File Operations
Advanced

Sum a CSV column ([3, 3, 3, 3, 3])

Parse the CSV with the csv module and print the sum of the 'qty' column.

File Operations
Advanced

Length of the longest line ([3, 3, 3, 3, 3])

Print the length of the longest line in the text.

File Operations
Advanced

Count the lines of a text block ([40, 2])

The text has 2 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line ([40, 2])

Each line of the text holds a number. Print the total of [40, 2].

File Operations
Advanced

Count words in a paragraph ([40, 2])

Print how many words are in the text 'every record tells a story'.

File Operations
Advanced

Count lines containing 'step'

Print how many lines of the text contain 'step'.

File Operations
Advanced

Sum a CSV column ([40, 2])

Parse the CSV with the csv module and print the sum of the 'qty' column.

File Operations
Advanced

Length of the longest line ([40, 2])

Print the length of the longest line in the text.

File Operations
Advanced

Count the lines of a text block ([1, 1, 1, 1, 1, 1])

The text has 9 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line ([1, 1, 1, 1, 1, 1])

Each line of the text holds a number. Print the total of [1, 1, 1, 1, 1, 1].

File Operations
Advanced

Count words in a paragraph ([1, 1, 1, 1, 1, 1])

Print how many words are in the text 'parse then validate then store'.

File Operations
Advanced

Count lines containing 'fail'

Print how many lines of the text contain 'fail'.

File Operations
Advanced

Length of the longest line ([1, 1, 1, 1, 1, 1])

Print the length of the longest line in the text.

File Operations
Advanced

Sum numbers, one per line ([12, 8, 20])

Each line of the text holds a number. Print the total of [12, 8, 20].

File Operations
Advanced

Count words in a paragraph ([12, 8, 20])

Print how many words are in the text 'streams flow through the buffer'.

File Operations
Advanced

Sum numbers, one per line ([9, 9, 9])

Each line of the text holds a number. Print the total of [9, 9, 9].

File Operations
Advanced

Count words in a paragraph ([9, 9, 9])

Print how many words are in the text 'errors hide in the edge cases'.

File Operations
Advanced

Sum numbers, one per line ([50, 50])

Each line of the text holds a number. Print the total of [50, 50].

File Operations
Advanced

Count words in a paragraph ([50, 50])

Print how many words are in the text 'tokens become trees become code'.

File Operations
Advanced

Count the lines of a text block ([2, 2, 2, 2])

The text has 10 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line ([2, 2, 2, 2])

Each line of the text holds a number. Print the total of [2, 2, 2, 2].

File Operations
Advanced

Count words in a paragraph ([2, 2, 2, 2])

Print how many words are in the text 'cache the slow parts only'.

File Operations
Advanced

Sum numbers, one per line ([11, 21, 31])

Each line of the text holds a number. Print the total of [11, 21, 31].

File Operations
Advanced

Sum numbers, one per line ([6, 6, 6, 6])

Each line of the text holds a number. Print the total of [6, 6, 6, 6].

File Operations
Advanced

Sum numbers, one per line ([8, 2, 10, 3, 5])

Each line of the text holds a number. Print the total of [8, 2, 10, 3, 5].

File Operations
Advanced

Sum numbers, one per line ([101, 51, 26])

Each line of the text holds a number. Print the total of [101, 51, 26].

File Operations
Advanced

Sum numbers, one per line ([3, 5, 7, 9])

Each line of the text holds a number. Print the total of [3, 5, 7, 9].

File Operations
Advanced

Sum numbers, one per line ([4, 4, 4, 4, 4])

Each line of the text holds a number. Print the total of [4, 4, 4, 4, 4].

File Operations
Advanced

Sum numbers, one per line ([41, 3])

Each line of the text holds a number. Print the total of [41, 3].

File Operations
Advanced

Sum numbers, one per line ([2, 2, 2, 2, 2, 2])

Each line of the text holds a number. Print the total of [2, 2, 2, 2, 2, 2].

File Operations
Advanced

Sum numbers, one per line ([13, 9, 21])

Each line of the text holds a number. Print the total of [13, 9, 21].

File Operations
Advanced

Sum numbers, one per line ([10, 10, 10])

Each line of the text holds a number. Print the total of [10, 10, 10].

File Operations
Advanced

Sum numbers, one per line ([51, 51])

Each line of the text holds a number. Print the total of [51, 51].

File Operations
Advanced

Count the lines of a text block ([3, 3, 3, 3])

The text has 17 lines. Read it from a StringIO and print the line count.

File Operations
Advanced

Sum numbers, one per line ([3, 3, 3, 3])

Each line of the text holds a number. Print the total of [3, 3, 3, 3].

File Operations
Advanced

Sum numbers, one per line ([12, 22, 32])

Each line of the text holds a number. Print the total of [12, 22, 32].

File Operations
Advanced

Sum numbers, one per line ([7, 7, 7, 7])

Each line of the text holds a number. Print the total of [7, 7, 7, 7].

File Operations
Advanced

Sum numbers, one per line ([9, 3, 11, 4, 6])

Each line of the text holds a number. Print the total of [9, 3, 11, 4, 6].

File Operations

Libraries

71
Advanced

Most common item with Counter

Use collections.Counter to print the most common value in [3, 1, 3, 2, 3] and its count, like `value count`.

Libraries
Advanced

Factorial of 5 with math

Use math.factorial to print 5 factorial.

Libraries
Advanced

gcd(5, 12) with math

Use math.gcd to print the greatest common divisor of 5 and 12.

Libraries
Advanced

Sum amounts from JSON

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries
Advanced

Extract numbers with regex

Use re.findall to print the sum of every number embedded in the text.

Libraries
Advanced

Rotate a deque by 1

Use collections.deque to rotate [3, 1, 3, 2, 3] right by 1 and print the result as a list.

Libraries
Advanced

Seeded dice roll (seed 0)

Seed random with 0, then print the sum of 1 dice rolls (random.randint(1,6)).

Libraries
Advanced

Group numbers by parity

Use a defaultdict to group [3, 1, 3, 2, 3] into 'even' and 'odd' lists and print the dict.

Libraries
Advanced

Most common item with Counter ([7, 7, 1, 9])

Use collections.Counter to print the most common value in [7, 7, 1, 9] and its count, like `value count`.

Libraries
Advanced

Factorial of 6 with math

Use math.factorial to print 6 factorial.

Libraries
Advanced

gcd(6, 8) with math

Use math.gcd to print the greatest common divisor of 6 and 8.

Libraries
Advanced

Sum amounts from JSON ([7, 7, 1, 9])

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries
Advanced

Extract numbers with regex ([7, 7, 1, 9])

Use re.findall to print the sum of every number embedded in the text.

Libraries
Advanced

Rotate a deque by 2

Use collections.deque to rotate [7, 7, 1, 9] right by 2 and print the result as a list.

Libraries
Advanced

Seeded dice roll (seed 1)

Seed random with 1, then print the sum of 2 dice rolls (random.randint(1,6)).

Libraries
Advanced

Group numbers by parity ([7, 7, 1, 9])

Use a defaultdict to group [7, 7, 1, 9] into 'even' and 'odd' lists and print the dict.

Libraries
Advanced

Most common item with Counter ([2, 4, 2, 4, 2])

Use collections.Counter to print the most common value in [2, 4, 2, 4, 2] and its count, like `value count`.

Libraries
Advanced

Factorial of 4 with math

Use math.factorial to print 4 factorial.

Libraries
Advanced

gcd(4, 9) with math

Use math.gcd to print the greatest common divisor of 4 and 9.

Libraries
Advanced

Sum amounts from JSON ([2, 4, 2, 4, 2])

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries
Advanced

Extract numbers with regex ([2, 4, 2, 4, 2])

Use re.findall to print the sum of every number embedded in the text.

Libraries
Advanced

Rotate a deque by 3

Use collections.deque to rotate [2, 4, 2, 4, 2] right by 3 and print the result as a list.

Libraries
Advanced

Seeded dice roll (seed 7)

Seed random with 7, then print the sum of 3 dice rolls (random.randint(1,6)).

Libraries
Advanced

Group numbers by parity ([2, 4, 2, 4, 2])

Use a defaultdict to group [2, 4, 2, 4, 2] into 'even' and 'odd' lists and print the dict.

Libraries
Advanced

Most common item with Counter ([8, 8, 8, 1])

Use collections.Counter to print the most common value in [8, 8, 8, 1] and its count, like `value count`.

Libraries
Advanced

Factorial of 7 with math

Use math.factorial to print 7 factorial.

Libraries
Advanced

gcd(7, 21) with math

Use math.gcd to print the greatest common divisor of 7 and 21.

Libraries
Advanced

Sum amounts from JSON ([8, 8, 8, 1])

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries
Advanced

Extract numbers with regex ([8, 8, 8, 1])

Use re.findall to print the sum of every number embedded in the text.

Libraries
Advanced

Rotate a deque by 1 ([8, 8, 8, 1])

Use collections.deque to rotate [8, 8, 8, 1] right by 1 and print the result as a list.

Libraries
Advanced

Seeded dice roll (seed 42)

Seed random with 42, then print the sum of 1 dice rolls (random.randint(1,6)).

Libraries
Advanced

Group numbers by parity ([8, 8, 8, 1])

Use a defaultdict to group [8, 8, 8, 1] into 'even' and 'odd' lists and print the dict.

Libraries
Advanced

Most common item with Counter ([5, 9, 5, 5, 1])

Use collections.Counter to print the most common value in [5, 9, 5, 5, 1] and its count, like `value count`.

Libraries
Advanced

Factorial of 3 with math

Use math.factorial to print 3 factorial.

Libraries
Advanced

gcd(3, 15) with math

Use math.gcd to print the greatest common divisor of 3 and 15.

Libraries
Advanced

Sum amounts from JSON ([5, 9, 5, 5, 1])

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries
Advanced

Extract numbers with regex ([5, 9, 5, 5, 1])

Use re.findall to print the sum of every number embedded in the text.

Libraries
Advanced

Rotate a deque by 2 ([5, 9, 5, 5, 1])

Use collections.deque to rotate [5, 9, 5, 5, 1] right by 2 and print the result as a list.

Libraries
Advanced

Seeded dice roll (seed 3)

Seed random with 3, then print the sum of 2 dice rolls (random.randint(1,6)).

Libraries
Advanced

Group numbers by parity ([5, 9, 5, 5, 1])

Use a defaultdict to group [5, 9, 5, 5, 1] into 'even' and 'odd' lists and print the dict.

Libraries
Advanced

Most common item with Counter ([4, 2, 4, 3, 4])

Use collections.Counter to print the most common value in [4, 2, 4, 3, 4] and its count, like `value count`.

Libraries
Advanced

gcd(6, 19) with math

Use math.gcd to print the greatest common divisor of 6 and 19.

Libraries
Advanced

Sum amounts from JSON ([4, 2, 4, 3, 4])

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries
Advanced

Extract numbers with regex ([4, 2, 4, 3, 4])

Use re.findall to print the sum of every number embedded in the text.

Libraries
Advanced

Rotate a deque by 2 ([4, 2, 4, 3, 4])

Use collections.deque to rotate [4, 2, 4, 3, 4] right by 2 and print the result as a list.

Libraries
Advanced

Group numbers by parity ([4, 2, 4, 3, 4])

Use a defaultdict to group [4, 2, 4, 3, 4] into 'even' and 'odd' lists and print the dict.

Libraries
Advanced

Most common item with Counter ([8, 8, 2, 10])

Use collections.Counter to print the most common value in [8, 8, 2, 10] and its count, like `value count`.

Libraries
Advanced

gcd(7, 9) with math

Use math.gcd to print the greatest common divisor of 7 and 9.

Libraries
Advanced

Sum amounts from JSON ([8, 8, 2, 10])

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries
Advanced

Extract numbers with regex ([8, 8, 2, 10])

Use re.findall to print the sum of every number embedded in the text.

Libraries
Advanced

Rotate a deque by 3 ([8, 8, 2, 10])

Use collections.deque to rotate [8, 8, 2, 10] right by 3 and print the result as a list.

Libraries
Advanced

Seeded dice roll (seed 2)

Seed random with 2, then print the sum of 3 dice rolls (random.randint(1,6)).

Libraries
Advanced

Group numbers by parity ([8, 8, 2, 10])

Use a defaultdict to group [8, 8, 2, 10] into 'even' and 'odd' lists and print the dict.

Libraries
Advanced

Most common item with Counter ([3, 5, 3, 5, 3])

Use collections.Counter to print the most common value in [3, 5, 3, 5, 3] and its count, like `value count`.

Libraries
Advanced

gcd(5, 10) with math

Use math.gcd to print the greatest common divisor of 5 and 10.

Libraries
Advanced

Sum amounts from JSON ([3, 5, 3, 5, 3])

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries
Advanced

Extract numbers with regex ([3, 5, 3, 5, 3])

Use re.findall to print the sum of every number embedded in the text.

Libraries
Advanced

Rotate a deque by 4

Use collections.deque to rotate [3, 5, 3, 5, 3] right by 4 and print the result as a list.

Libraries
Advanced

Seeded dice roll (seed 8)

Seed random with 8, then print the sum of 4 dice rolls (random.randint(1,6)).

Libraries
Advanced

Group numbers by parity ([3, 5, 3, 5, 3])

Use a defaultdict to group [3, 5, 3, 5, 3] into 'even' and 'odd' lists and print the dict.

Libraries
Advanced

Most common item with Counter ([9, 9, 9, 2])

Use collections.Counter to print the most common value in [9, 9, 9, 2] and its count, like `value count`.

Libraries
Advanced

Factorial of 8 with math

Use math.factorial to print 8 factorial.

Libraries
Advanced

gcd(8, 28) with math

Use math.gcd to print the greatest common divisor of 8 and 28.

Libraries
Advanced

Sum amounts from JSON ([9, 9, 9, 2])

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries
Advanced

Extract numbers with regex ([9, 9, 9, 2])

Use re.findall to print the sum of every number embedded in the text.

Libraries
Advanced

Rotate a deque by 2 ([9, 9, 9, 2])

Use collections.deque to rotate [9, 9, 9, 2] right by 2 and print the result as a list.

Libraries
Advanced

Seeded dice roll (seed 49)

Seed random with 49, then print the sum of 2 dice rolls (random.randint(1,6)).

Libraries
Advanced

Group numbers by parity ([9, 9, 9, 2])

Use a defaultdict to group [9, 9, 9, 2] into 'even' and 'odd' lists and print the dict.

Libraries
Advanced

Most common item with Counter ([6, 10, 6, 6, 2])

Use collections.Counter to print the most common value in [6, 10, 6, 6, 2] and its count, like `value count`.

Libraries
Advanced

gcd(4, 22) with math

Use math.gcd to print the greatest common divisor of 4 and 22.

Libraries
Advanced

Sum amounts from JSON ([6, 10, 6, 6, 2])

Parse the JSON list of orders and print the total of the `amount` fields.

Libraries

Projects

71
Advanced

Shopping cart total with 10% off

Sum the prices [20, 35, 15], apply a 10% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average

Print the average of the scores [20, 35, 15] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions

The transactions [100, -30, 50, -20] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $90 bill 3 ways

Split a bill of 90 between 3 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 5)

Stock levels are [20, 35, 15]. Print how many are below the reorder threshold 5.

Projects
Advanced

Receipt total with 10% tax

A subtotal of 90 has 10% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Most frequent word report

Print the most frequent word in 'go team go team win'.

Projects
Advanced

Shopping cart total with 15% off

Sum the prices [88, 92, 79, 95], apply a 15% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([88, 92, 79, 95])

Print the average of the scores [88, 92, 79, 95] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([88, 92, 79, 95])

The transactions [200, -50, -40] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $120 bill 4 ways

Split a bill of 120 between 4 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 10)

Stock levels are [88, 92, 79, 95]. Print how many are below the reorder threshold 10.

Projects
Advanced

Receipt total with 15% tax

A subtotal of 120 has 15% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Most frequent word report ([88, 92, 79, 95])

Print the most frequent word in 'data data code data ship'.

Projects
Advanced

Shopping cart total with 20% off

Sum the prices [10, 10, 10, 10], apply a 20% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([10, 10, 10, 10])

Print the average of the scores [10, 10, 10, 10] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([10, 10, 10, 10])

The transactions [40, 40, -25] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $75 bill 5 ways

Split a bill of 75 between 5 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 8)

Stock levels are [10, 10, 10, 10]. Print how many are below the reorder threshold 8.

Projects
Advanced

Receipt total with 20% tax

A subtotal of 75 has 20% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Most frequent word report ([10, 10, 10, 10])

Print the most frequent word in 'run fast run far run'.

Projects
Advanced

Shopping cart total with 25% off

Sum the prices [70, 60, 90], apply a 25% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([70, 60, 90])

Print the average of the scores [70, 60, 90] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([70, 60, 90])

The transactions [150, -100, 30, -20] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $100 bill 2 ways

Split a bill of 100 between 2 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 3)

Stock levels are [70, 60, 90]. Print how many are below the reorder threshold 3.

Projects
Advanced

Receipt total with 25% tax

A subtotal of 100 has 25% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Most frequent word report ([70, 60, 90])

Print the most frequent word in 'save more save now save'.

Projects
Advanced

Shopping cart total with 5% off

Sum the prices [45, 55, 65, 75], apply a 5% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([45, 55, 65, 75])

Print the average of the scores [45, 55, 65, 75] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([45, 55, 65, 75])

The transactions [300, -120, -80] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $250 bill 6 ways

Split a bill of 250 between 6 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 20)

Stock levels are [45, 55, 65, 75]. Print how many are below the reorder threshold 20.

Projects
Advanced

Receipt total with 5% tax

A subtotal of 250 has 5% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Most frequent word report ([45, 55, 65, 75])

Print the most frequent word in 'test then ship then test'.

Projects
Advanced

Shopping cart total with 17% off

Sum the prices [21, 36, 16], apply a 17% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([21, 36, 16])

Print the average of the scores [21, 36, 16] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([21, 36, 16])

The transactions [101, -29, 51, -19] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $97 bill 4 ways

Split a bill of 97 between 4 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 6)

Stock levels are [21, 36, 16]. Print how many are below the reorder threshold 6.

Projects
Advanced

Receipt total with 17% tax

A subtotal of 97 has 17% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Shopping cart total with 22% off

Sum the prices [89, 93, 80, 96], apply a 22% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([89, 93, 80, 96])

Print the average of the scores [89, 93, 80, 96] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([89, 93, 80, 96])

The transactions [201, -49, -39] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $127 bill 5 ways

Split a bill of 127 between 5 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 17)

Stock levels are [89, 93, 80, 96]. Print how many are below the reorder threshold 17.

Projects
Advanced

Receipt total with 22% tax

A subtotal of 127 has 22% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Shopping cart total with 27% off

Sum the prices [11, 11, 11, 11], apply a 27% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([11, 11, 11, 11])

Print the average of the scores [11, 11, 11, 11] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([11, 11, 11, 11])

The transactions [41, 41, -24] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $82 bill 6 ways

Split a bill of 82 between 6 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 9)

Stock levels are [11, 11, 11, 11]. Print how many are below the reorder threshold 9.

Projects
Advanced

Receipt total with 27% tax

A subtotal of 82 has 27% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Shopping cart total with 32% off

Sum the prices [71, 61, 91], apply a 32% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([71, 61, 91])

Print the average of the scores [71, 61, 91] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([71, 61, 91])

The transactions [151, -99, 31, -19] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $107 bill 3 ways

Split a bill of 107 between 3 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 4)

Stock levels are [71, 61, 91]. Print how many are below the reorder threshold 4.

Projects
Advanced

Receipt total with 32% tax

A subtotal of 107 has 32% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Shopping cart total with 6% off

Sum the prices [46, 56, 66, 76], apply a 6% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([46, 56, 66, 76])

Print the average of the scores [46, 56, 66, 76] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([46, 56, 66, 76])

The transactions [301, -119, -79] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $257 bill 7 ways

Split a bill of 257 between 7 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 27)

Stock levels are [46, 56, 66, 76]. Print how many are below the reorder threshold 27.

Projects
Advanced

Receipt total with 6% tax

A subtotal of 257 has 6% tax added. Print the final total rounded to 2 decimals.

Projects
Advanced

Shopping cart total with 24% off

Sum the prices [22, 37, 17], apply a 24% discount, and print the total rounded to 2 decimals.

Projects
Advanced

Gradebook average ([22, 37, 17])

Print the average of the scores [22, 37, 17] rounded to 1 decimal.

Projects
Advanced

Bank net balance from transactions ([22, 37, 17])

The transactions [102, -28, 52, -18] mix deposits (+) and withdrawals (−). Print the net balance.

Projects
Advanced

Split a $104 bill 5 ways

Split a bill of 104 between 5 people. Print the per-person amount rounded to 2 decimals.

Projects
Advanced

Count low-stock items (under 7)

Stock levels are [22, 37, 17]. Print how many are below the reorder threshold 7.

Projects
Advanced

Receipt total with 24% tax

A subtotal of 104 has 24% tax added. Print the final total rounded to 2 decimals.

Projects

Expert

71
Advanced

Decorator that scales by 2

Write a decorator that multiplies a function's result by 2. Decorate add(a,b) and print add(3,4).

Expert
Advanced

Generator of squares to 10

Write a generator yielding the squares of 1..10 and print their sum.

Expert
Advanced

Product with reduce

Use functools.reduce to print the product of [1, 2, 3, 4].

Expert
Advanced

Memoized Fibonacci #10

Use @lru_cache to write fib(n) and print fib(10).

Expert
Advanced

Count pairs from 5 items

Use itertools.combinations to print how many 2-item pairs come from a list of 5 items.

Expert
Advanced

Closure counter to 2

Write a closure counter; call it 2 times and print the final value.

Expert
Advanced

Running totals with accumulate

Use itertools.accumulate to print the running totals of [1, 2, 3, 4].

Expert
Advanced

Decorator that scales by 3

Write a decorator that multiplies a function's result by 3. Decorate add(a,b) and print add(5,6).

Expert
Advanced

Generator of squares to 12

Write a generator yielding the squares of 1..12 and print their sum.

Expert
Advanced

Product with reduce ([2, 3, 4])

Use functools.reduce to print the product of [2, 3, 4].

Expert
Advanced

Memoized Fibonacci #12

Use @lru_cache to write fib(n) and print fib(12).

Expert
Advanced

Count pairs from 6 items

Use itertools.combinations to print how many 2-item pairs come from a list of 6 items.

Expert
Advanced

Closure counter to 3

Write a closure counter; call it 3 times and print the final value.

Expert
Advanced

Running totals with accumulate ([2, 3, 4])

Use itertools.accumulate to print the running totals of [2, 3, 4].

Expert
Advanced

Decorator that scales by 5

Write a decorator that multiplies a function's result by 5. Decorate add(a,b) and print add(7,1).

Expert
Advanced

Generator of squares to 8

Write a generator yielding the squares of 1..8 and print their sum.

Expert
Advanced

Product with reduce ([5, 5, 2])

Use functools.reduce to print the product of [5, 5, 2].

Expert
Advanced

Memoized Fibonacci #8

Use @lru_cache to write fib(n) and print fib(8).

Expert
Advanced

Count pairs from 4 items

Use itertools.combinations to print how many 2-item pairs come from a list of 4 items.

Expert
Advanced

Closure counter to 5

Write a closure counter; call it 5 times and print the final value.

Expert
Advanced

Running totals with accumulate ([5, 5, 2])

Use itertools.accumulate to print the running totals of [5, 5, 2].

Expert
Advanced

Decorator that scales by 4

Write a decorator that multiplies a function's result by 4. Decorate add(a,b) and print add(2,9).

Expert
Advanced

Generator of squares to 15

Write a generator yielding the squares of 1..15 and print their sum.

Expert
Advanced

Product with reduce ([1, 2, 3, 4, 5])

Use functools.reduce to print the product of [1, 2, 3, 4, 5].

Expert
Advanced

Memoized Fibonacci #15

Use @lru_cache to write fib(n) and print fib(15).

Expert
Advanced

Count pairs from 7 items

Use itertools.combinations to print how many 2-item pairs come from a list of 7 items.

Expert
Advanced

Closure counter to 4

Write a closure counter; call it 4 times and print the final value.

Expert
Advanced

Running totals with accumulate ([1, 2, 3, 4, 5])

Use itertools.accumulate to print the running totals of [1, 2, 3, 4, 5].

Expert
Advanced

Decorator that scales by 10

Write a decorator that multiplies a function's result by 10. Decorate add(a,b) and print add(8,8).

Expert
Advanced

Generator of squares to 9

Write a generator yielding the squares of 1..9 and print their sum.

Expert
Advanced

Product with reduce ([10, 2, 3])

Use functools.reduce to print the product of [10, 2, 3].

Expert
Advanced

Memoized Fibonacci #9

Use @lru_cache to write fib(n) and print fib(9).

Expert
Advanced

Count pairs from 8 items

Use itertools.combinations to print how many 2-item pairs come from a list of 8 items.

Expert
Advanced

Closure counter to 10

Write a closure counter; call it 10 times and print the final value.

Expert
Advanced

Running totals with accumulate ([10, 2, 3])

Use itertools.accumulate to print the running totals of [10, 2, 3].

Expert
Advanced

Decorator that scales by 3 ([2, 3, 4, 5])

Write a decorator that multiplies a function's result by 3. Decorate add(a,b) and print add(4,5).

Expert
Advanced

Generator of squares to 17

Write a generator yielding the squares of 1..17 and print their sum.

Expert
Advanced

Product with reduce ([2, 3, 4, 5])

Use functools.reduce to print the product of [2, 3, 4, 5].

Expert
Advanced

Memoized Fibonacci #17

Use @lru_cache to write fib(n) and print fib(17).

Expert
Advanced

Running totals with accumulate ([2, 3, 4, 5])

Use itertools.accumulate to print the running totals of [2, 3, 4, 5].

Expert
Advanced

Decorator that scales by 4 ([3, 4, 5])

Write a decorator that multiplies a function's result by 4. Decorate add(a,b) and print add(6,7).

Expert
Advanced

Generator of squares to 19

Write a generator yielding the squares of 1..19 and print their sum.

Expert
Advanced

Product with reduce ([3, 4, 5])

Use functools.reduce to print the product of [3, 4, 5].

Expert
Advanced

Memoized Fibonacci #19

Use @lru_cache to write fib(n) and print fib(19).

Expert
Advanced

Running totals with accumulate ([3, 4, 5])

Use itertools.accumulate to print the running totals of [3, 4, 5].

Expert
Advanced

Decorator that scales by 6

Write a decorator that multiplies a function's result by 6. Decorate add(a,b) and print add(8,2).

Expert
Advanced

Product with reduce ([6, 6, 3])

Use functools.reduce to print the product of [6, 6, 3].

Expert
Advanced

Closure counter to 6

Write a closure counter; call it 6 times and print the final value.

Expert
Advanced

Running totals with accumulate ([6, 6, 3])

Use itertools.accumulate to print the running totals of [6, 6, 3].

Expert
Advanced

Decorator that scales by 5 ([2, 3, 4, 5, 6])

Write a decorator that multiplies a function's result by 5. Decorate add(a,b) and print add(3,10).

Expert
Advanced

Generator of squares to 22

Write a generator yielding the squares of 1..22 and print their sum.

Expert
Advanced

Product with reduce ([2, 3, 4, 5, 6])

Use functools.reduce to print the product of [2, 3, 4, 5, 6].

Expert
Advanced

Memoized Fibonacci #22

Use @lru_cache to write fib(n) and print fib(22).

Expert
Advanced

Running totals with accumulate ([2, 3, 4, 5, 6])

Use itertools.accumulate to print the running totals of [2, 3, 4, 5, 6].

Expert
Advanced

Decorator that scales by 17

Write a decorator that multiplies a function's result by 17. Decorate add(a,b) and print add(9,9).

Expert
Advanced

Product with reduce ([11, 3, 4])

Use functools.reduce to print the product of [11, 3, 4].

Expert
Advanced

Count pairs from 9 items

Use itertools.combinations to print how many 2-item pairs come from a list of 9 items.

Expert
Advanced

Closure counter to 17

Write a closure counter; call it 17 times and print the final value.

Expert
Advanced

Running totals with accumulate ([11, 3, 4])

Use itertools.accumulate to print the running totals of [11, 3, 4].

Expert
Advanced

Decorator that scales by 4 ([3, 4, 5, 6])

Write a decorator that multiplies a function's result by 4. Decorate add(a,b) and print add(5,6).

Expert
Advanced

Generator of squares to 24

Write a generator yielding the squares of 1..24 and print their sum.

Expert
Advanced

Product with reduce ([3, 4, 5, 6])

Use functools.reduce to print the product of [3, 4, 5, 6].

Expert
Advanced

Memoized Fibonacci #24

Use @lru_cache to write fib(n) and print fib(24).

Expert
Advanced

Running totals with accumulate ([3, 4, 5, 6])

Use itertools.accumulate to print the running totals of [3, 4, 5, 6].

Expert
Advanced

Decorator that scales by 5 ([4, 5, 6])

Write a decorator that multiplies a function's result by 5. Decorate add(a,b) and print add(7,8).

Expert
Advanced

Generator of squares to 26

Write a generator yielding the squares of 1..26 and print their sum.

Expert
Advanced

Product with reduce ([4, 5, 6])

Use functools.reduce to print the product of [4, 5, 6].

Expert
Advanced

Memoized Fibonacci #26

Use @lru_cache to write fib(n) and print fib(26).

Expert
Advanced

Running totals with accumulate ([4, 5, 6])

Use itertools.accumulate to print the running totals of [4, 5, 6].

Expert
Advanced

Decorator that scales by 7

Write a decorator that multiplies a function's result by 7. Decorate add(a,b) and print add(9,3).

Expert
Advanced

Product with reduce ([7, 7, 4])

Use functools.reduce to print the product of [7, 7, 4].

Expert