Utilizor
Contact Us

Python Numbers

Int, Float, Complex.

Examples

Number Types

Checking number types.

x = 1    # int
y = 2.8  # float
z = 1j   # complex

print(type(x))
print(type(y))
print(type(z))

Float

Floats can be positive or negative, containing one or more decimals.

x = 1.10
y = 1.0
z = -35.59
print(type(x))
print(type(y))
print(type(z))

Test Your Knowledge

Python Quiz

No quiz available for this topic yet.