Python Complex Datatypes
A complex number is a number with a real and an imaginary component represented as a+bj where a and b contain integers or floating-point values.
# both values are int type
a = 9 + 8j
print(a)
print(type(a))
# one int and one float values
b = 10 + 4.5j
print(b)
print(type(b))
# both values are float type
c = 11.2 + 1.2j
print(c)
print(type(c))

No comments:
Post a Comment