Arithmetic Flashcards
3 = 2+1
What operation is used?
Addition
4-1 = 3
What operation is used?
Subtraction
2*2
What operation is used?
Multiplication
5/2
What operation is being used?
Division
What is floor division and give an example?
Floor division uses the // operator which truncates the decimal without rounding and returns an integer result.
e.g. 7//4 = 1
How do we get just the remainder after division?
The % operater returns the remainder after division.
7%4 = 3 because 4 goes into 7 once and the remainder is 3.
Give an example of the power operator
(Use ** to find the power)
e.g. 23 or 42 or 5**2
3+2 = ?
5
5-2 =
3
3*3 =
9
3/2 =
1.5
6//4 =
1
2**3 =
8
4*0.5
2.0
2 + 10 * 10 + 3 =
105
(2+10) * (10+3)
156
Write an equation that uses multiplication, division, an exponent, addition and subtraction that is equal to 100.25
Answer may differ.
x = 1.25 + (528/2) -1
or
x = 37.25 + (4**32/2) -1
What is the value of they expression 4 * (6 + 5)
44
4 * 6 + 5
29
4 + 6 * 5
34
What is the type of result of the expression 3 + 1.5 + 4?
Floating point number
5**2
25
10 ** 2
100
What are numbers in Python?
Python has various types of number. Integers for one, are just whole numbers positive or negative e.g. 2 and -2.
Floating point numbers have a decimal point or use exponential (e) to define numbers. e.g. 2.0 and -2.1 and 4E2 (4 times 10 to the power of 2)