+ 12
c=-8j print(c) can anyone explain me why the output is like that -0 -8j why negative 0
2 Answers
+ 4
Correct me if i am wrong..šš»
..
ā”ļøI python you have wrote
c = -8j
By default it reads it as a complex number
In py complex no. Is denoted by j not i(iota)
I hope you previously know about Complex number (x+iy) where x is real part and y is imaginary part.
So -8j in py prints out -0-8j ; it tells real part as 0 ( -0 ; i think it includes third quadrant ,in third quad. Both real(x) & imaginary (y) is -ve )
It doesn't makes more sense +0/-0
In any case real part will be zero..
.
.
.
ā”ļøIf you want output as -8j write
Print("-8j")šš»