Answers for "complex python"

4

complex num in python

c = 1 + 2j # or c = complex(1, 2)
print(c) # (1+2j)
print(type(c)) # <class 'complex'>
print(c.real()) # 1.0
print(c.imag()) # 2.0
print(c + complex(3, -5)) # (4-3j)
Posted by: Guest on May-31-2021
1

complex number in python

# It is best to represent the complex part of your equation this way:
c = 1j
# rather than using 
complex(x,y)
# which can sometimes cause "issues"
Posted by: Guest on November-08-2021
1

complex numbers python

c = 1 + 2j
print(type(c))
print(c)

c1 = complex(2, 4)
print(type(c1))
print(c1)
Posted by: Guest on October-17-2020
0

abs of complex nos in python

abs(5j+9)  #square root of 5^2 +9^2
Posted by: Guest on June-05-2020

Python Answers by Framework

Browse Popular Code Answers by Language