Discuss / Python / zuoye

zuoye

Topic source

a=input("pls enter first number:") b=input("pls enter second number:") c=input("pls enter third number:") a=int(a) b=int(b) c=int(c) import math x1=((-b)+(math.sqrt(bb-4ac)))/(2a) x2=((-b)-(math.sqrt(bb-4ac)))/(2a) print(x1,x2)

a=input("pls enter first number:") b=input("pls enter second number:") c=input("pls enter third number:") a=float(a) b=float(b) c=float(c) if a==0: x=(-c)/b print("only one solution:",x) elif bb-4ac<0: print("no solution") else: import math x1=((-b)+(math.sqrt(bb-4ac)))/(2a) x2=((-b)-(math.sqrt(bb-4ac)))/(2*a) print("two solution:",x1,x2)


  • 1

Reply