Imports, online
Six activities your students do on their own devices. See who's finished, and their scores.
Learning
Understanding
Testing
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.
What students will learn in this module
Every question in Module 17
Quick questions
- What does // do?AInteger division (no decimal)BRegular division
- What does % do?AReturns the remainderBCalculates percentage
- What does ** do?AMultiplies twiceBRaises to a power (exponent)
- What is 10 // 3?A3B3.33
- What is 10 % 3?A3B1
Key terms
Students type the meaning of:
//%**Remainder
Match the pairs
result = 10 % 0Match it to what it does2 ^ 3Match it to what it does10 % 2 == 0Match it to what it does2 ** 10Match it to what it doesprint(17 // 5)Match it to what it doesprint(17 % 5)Match it to what it doesFill in the blanks
print(10 __ 3) # Result: 3
print(10 _ 3) # Result: 1
print(2 __ 3) # Result: 8
print(7 _ 2) # Result: 1 (remainder)
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)
