How to create a complex number in Python

1 Answer

0 votes
c = complex(3, -5)
print(c)

c = complex(1)
print(c)

c = complex(0)
print(c)

c = complex()
print(c)

c = complex('3-6j')
print(c)

 
 
 
'''
run:
 
(3-5j)
(1+0j)
0j
0j
(3-6j)
 
'''

 



answered Apr 25, 2021 by avibootz

Related questions

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