How to print complex number in Python

1 Answer

0 votes
z = complex(3, -5)

print(z)

print(z.real)
print(z.imag)

 
 
 
'''
run:
 
(3-5j)
3.0
-5.0
 
'''

 



answered Apr 25, 2021 by avibootz

Related questions

1 answer 160 views
1 answer 192 views
1 answer 153 views
153 views asked Apr 25, 2021 by avibootz
1 answer 252 views
1 answer 236 views
1 answer 244 views
...