# Declare a complex number
c = 3 + 4j
# Printing the real and imaginary parts of the complex number
print(c.real) # Output: 3.0
print(c.imag) # Output: 4.0
# Addition, subtraction, multiplication, and division with complex numbers
a = 2 + 3j
b = 1 + 2j
# Addition
addition = a + b
print(addition) # Output: (3+5j)
# Subtraction
subtraction = a - b
print(subtraction) # Output: (1+1j)
# Multiplication
multiplication = a * b
print(multiplication) # Output: (-4+7j)
# Division
division = a / b
print(division) # Output: (1.6-0.2j)
# Accessing modulus and phase of a complex number
import cmath
c = 1 + 1j
modulus = abs(c)
phase = cmath.phase(c)
print(modulus) # Output: 1.4142135623730951
print(phase) # Output: 0.7853981633974483