complex()
complex([real[, imag]])z = complex(2, 3)
print(z) # Выведет (2+3j)z = complex("3+4j")
print(z) # Выведет (3+4j)z = complex(5)
print(z) # Выведет (5+0j)z1 = complex(2, 3)
z2 = complex(4, 5)
print(z1 + z2) # Выведет (6+8j)
print(z1 * z2) # Выведет (-7+22j)z = complex(2, 3)
print(z.real) # Выведет 2.0
print(z.imag) # Выведет 3.0Последнее обновление