xxxxxxxxxx
def factor():
l = (b ** 2) - (4 * a * c)
ll = (b ** 2) - (4 * a * c)
xl = cmath.sqrt(l)
xo = cmath.sqrt(ll)
l_s = f"{xl}"
ll_s = f"{xo}"
l = ""
for x in l_s:
if x in "j":
continue
else:
l += x
ll = ""
for k in ll_s:
if k in "j":
pass
else:
ll += k
l = float(l)
ll = float(ll)
x_plus = (-b + l)
x_minus = (-b - ll)
xxxxxxxxxx
complexNumber = 5.291502622129181j
var = f"{complexNumber}"
var = float(var[:len(var) -1])
xxxxxxxxxx
# integer variable.
a=100
print("The type of variable having value", a, " is ", type(a))
# float variable.
b=20.345
print("The type of variable having value", b, " is ", type(b))
# complex variable.
c=10+3j
print("The type of variable having value", c, " is ", type(c))