I am creating a calculator application for all types of mathematical algorithms. However, I want to identify if a root is complex and then have an exception for it. I came up with this:
if x == complex():
print("Error 05: Complex Root")
However, nothing is identified or printed when I run the app, knowing that x
is a complex root.
else
part ofif
statement? What aboutcomplex()
? Shouldn't you pass an argument to it and returnTrue
orFalse
?