Recall & Review
beginner
What does the
+ operator do in Python?The
+ operator adds two numbers together. For example, 3 + 2 equals 5.Click to reveal answer
beginner
What is the result of
7 - 4 in Python?The result is
3 because the - operator subtracts the right number from the left number.Click to reveal answer
beginner
Explain the
* operator in Python.The
* operator multiplies two numbers. For example, 5 * 6 equals 30.Click to reveal answer
beginner
What does the
/ operator do?The
/ operator divides the left number by the right number and gives a decimal result. For example, 8 / 4 equals 2.0.Click to reveal answer
intermediate
What is the difference between
/ and // operators?The
/ operator gives a decimal (float) result, while the // operator gives the whole number part only (floor division). For example, 7 / 2 is 3.5, but 7 // 2 is 3.Click to reveal answer
What is the result of
4 + 5 * 2 in Python?✗ Incorrect
Multiplication happens before addition, so 5 * 2 = 10, then 4 + 10 = 14.
Which operator gives the remainder of a division?
✗ Incorrect
The
% operator gives the remainder after division.What does
10 // 3 return?✗ Incorrect
// does floor division, so it returns the whole number part only.What is the output of
2 ** 3?✗ Incorrect
** is the power operator, so 2 to the power of 3 is 8.Which operator would you use to multiply two numbers?
✗ Incorrect
The
* operator multiplies two numbers.List the basic arithmetic operators in Python and explain what each one does.
Think about adding, subtracting, multiplying, dividing, and powers.
You got /14 concepts.
Explain the difference between
/ and // operators with examples.One gives decimals, the other gives whole numbers.
You got /5 concepts.