Imports, online

Six activities your students do on their own devices. See who's finished, and their scores.

Imports in one minute

What students need to know

Beyond the four basic operators, Python has three more. // (floor division) divides and rounds down to the nearest whole number, so 10 // 3 gives 3, not 3.33. % (modulo) returns the remainder left over after division — 10 % 3 is 1, because 3 goes into 10 three times with 1 left over. ** (exponent) raises the left number to the power of the right, so 2 ** 4 is 16. A common practical use of % is checking whether a number is even: number % 2 == 0.

Mistakes students make

  • Writing // with a space in between (a / / b) is a syntax error — it has to be two characters with no gap.
  • Confusing % with "percentage" is another: it always returns a whole-number remainder, not a percent.

Discover other journeys with this module

What students will learn in this module

Every question in Module 17

Quick questions

  1. What does // do?AInteger division (no decimal)BRegular division
  2. What does % do?AReturns the remainderBCalculates percentage
  3. What does ** do?AMultiplies twiceBRaises to a power (exponent)
  4. What is 10 // 3?A3B3.33
  5. What is 10 % 3?A3B1

Key terms

Students type the meaning of:

  • //
  • %
  • **
  • Remainder

Match the pairs

result = 10 % 0Match it to what it does
2 ^ 3Match it to what it does
10 % 2 == 0Match it to what it does
2 ** 10Match it to what it does
print(17 // 5)Match it to what it does
print(17 % 5)Match it to what it does

Fill in the blanks

  1. print(10 __ 3)  # Result: 3
  2. print(10 _ 3)  # Result: 1
  3. print(2 __ 3)  # Result: 8
  4. print(7 _ 2)  # Result: 1 (remainder)
  5. print(5 __ 2)  # Result: 25

Spot the error

Question 1

Aa = 10Bb = 3Cresult = a / / bDprint('Floor division:', result)

Question 2

Abase = 2Bexp = 3Cresult = base ^ expDprint('Power:', result)

Question 3

Aa = 10Bb = 3Cresult = a % % bDprint('Remainder:', result)

Question 4

Abase = 10Bexp = 3Cresult = base * * expDprint('Power:', result)

Question 5

Aresult = 10 mod 3Ba = 10Cb = 3Dprint('Remainder:', result)