hello :
This is my code :
------------------------------------------
------------------
when r<-1
############### ############### ############### ########
### the results are not like the casio calculater ###
############### ############### ############### ########
This is my code :
------------------------------------------
Code:
while True : try: ' enter the coefficients of the equation :' a=input('a=' ) b=input('b=' ) c=input('c=' ) r=b**2-4*a*c import cmath sq=cmath.sqrt if r==0 : x=(-b)/(2*a) y=(-b)/(2*a) print 'the roots are :',x,',',y elif r>0 : x=((-b)+sq(r))/(2*a) y=((-b)-sq(r))/(2*a) print 'the roots are :',x,',',y if r<-1 : i=sq(-1) x=(-b+(sq(r*(i**2))))/(2*a) y=(-b-(sq(r*(i**2))))/(2*a) print 'the roots are :',x,',',y except : print 'wrong inputs , please enter numbers only'
when r<-1
############### ############### ############### ########
### the results are not like the casio calculater ###
############### ############### ############### ########
Comment