c=-8j print(c) can anyone explain me why the output is like that -0 -8j why negative 0 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

c=-8j print(c) can anyone explain me why the output is like that -0 -8j why negative 0

9th Dec 2020, 4:05 PM
Code Black Web(Gamer)
Code Black Web(Gamer) - avatar
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")👍🏻
9th Dec 2020, 5:35 PM
Mr. Rahul
Mr. Rahul - avatar