Raising a number to a power by multiplying it by itself
Which symbol is used in Python to raise a number to a power?
**
What is meant by integer division (//)?
It gives the whole number of times one value goes into another
Which term describes the type of value always produced by the / operator, for example 3.5 or 4.0?
Real
What is meant by the multiplication operator (*)?
It finds the total when one number is added to itself a number of times
What does the + operator do when it is used with two strings?
It joins the two strings together into one string
When both values used are integers, which type of answer do the +, -, * and // operators give?
Integer
What is the result of 7 + 2?
9
What is the result of 12 - 5?
7
What is the result of 7 * 2?
14
What is the result of 7 / 2?
3.5
Which operator gives the remainder after whole-number division?
%
What is the result of 100 // 7?
14
Why does 8 / 2 give the answer 4.0?
Because the / operator always gives a real answer
When 12 % 3 is calculated, why is the answer 0?
Because 3 divides 12 exactly with nothing left over
What is the result of 3 // 10?
0
A student types 2 ^ 3 in Python, expecting the answer 8, but does not get 8. Why is this?
Because ^ is a different operator in Python, so 2 ** 3 is needed
17 sweets are shared equally between 5 people, so each person gets 3 sweets and 2 sweets are left over. Which calculation checks that none of the sweets have been lost?
5 * 3 + 2 = 17
What is the result of 7.0 // 2?
3.0
What is the result of 5 ** 2?
25
What is the result of 7 % 2?
1
Which term is the name of the operator that gives the amount left over after whole-number division?
Modulo
We use cookies to enhance your experience. You can manage your preferences or learn more in our Cookie Policy.