11. Basic Numbers

1print(type(3))
2print(type(3.14))
3print(type(3.0))
4x = -32
5print(type(x))
6x = 32.0
7print(type(x))
8print(type(int(x)))
line that just executed

next line to execute

Print output (drag lower right corner to resize)
Frames
Objects

Activity: CodeLens 11.1 (cl_l40_11a_en)

11.1. Operator Table

Operator Table

Operator

Operation

*

Multiplication

/

Division

**

Exponentiation

abs()

Absolute Value

%

Modulus

//

Integer Division

-

Subtraction

+

Addition

11.2. Numeric Operators

1print(3 + 4)
2print(3.0 + 4.0)
3print(3.0 * 4.0)
4print(4 ** 3)
5print(4.0 ** 3)
6print(abs(5))
7print(abs(-5))
line that just executed

next line to execute

Print output (drag lower right corner to resize)
Frames
Objects

Activity: CodeLens 11.2.1 (cl_l40_11b_en)

You have attempted 1 of 2 activities on this page