Skip to content

TypeScript code snippet – How to separate real and imaginary parts of a complex number in python?

let x = 6 + 9j be a complex number
to get the real part use the code : 
x.real
output==> 6.0
to get the imaginary part use the code: 
x.imag
output==> 9.0
See also  How to build an auto emailer in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.