Código Python:
Ver originaldef complejos (d,k):
if d==0 and k==0:
print(0)
elif d==0 and k==1:
print("i")
elif d==0 and k==-1:
print("-i")
elif d==0 and k!=0:
print(str(k) + "i")
elif d!=0 and k==0:
print(d)
elif k==-1:
print (str(d) + "-" + "i")
elif k<-1:
print (str(d)+ str(k)+"i")
elif k==1:
print (str(d) + "+" + "i")
elif k>1:
print (str(d)+ "+" + str(k)+"i")
else:
print (str(d) + str(k) + "i")
import math
a= input=2
b= input=4
c= input=1
if a==0:
print("no es una ecuacion de segundo grado")
else:
m=b**2-4*a*c
if m==0:
print(-b/(2*a))
elif m<0:
print(x1=(complejos(-b/(2*a),math.sqrt(m)+"i"/(2*a)))
print(x1=(complejos(-b/(2*a),-math.sqrt(m)+"i"/(2*a)))
else:
print(x1=(str(-b)+'+'+math.sqrt(m))/(2*a))
print(x2=(str(-b)+'-'+math.sqrt(m))/(2*a))
me da error y no se que es...