Q.

What is the output of the function complex()?

A. 0j
B. 0+0j
C. 0
D. error
Answer» A. 0j
Explanation: the complex function returns 0j if both of the arguments are omitted, that is, if the function is in the form of complex() or complex(0), then the output will be 0j.
3.8k
1
Do you find this helpful?
40

Discussion

coder developer
6 months ago

The complex() function in Python can be used to create a complex number. It can take up to two arguments: complex(real, imag). If no arguments are provided, it returns 0j, which represents the complex number 0.
0