For each of the expressions below, specify its type and value.
- 3 + 5.0
8.0
- 5 / 2
2.5
- 5 / 2 == 5 / 2.0
True
- 5 / 2.0
2.5
- round(2.6)
3
- int(2.6)
2
- math.floor(2.6)
2
Note: this involves calling a function floor from the math module. We’ll explain later what this means in detail. For now, you can just use the fact that it returns the greatest whole number less than the argument; but the type is a float.
- 2.0 + 5.0
7.0
- 5 * 2 == 5.0
False