Discuss / Python / 交作业

交作业

Topic source

赵彦臻

#1 Created at ... [Delete] [Delete and Lock User]

import math

a = int(input ( '请输入a :')) b = int(input ( '请输入b :')) c = int(input ( '请输入c :'))

def quadratic(a,b,c): m=bb-4ac if m <0: return('方程无实根') else: return ((-b+math.sqrt(bb-4ac))/2a,(-b+math.sqrt(bb-4ac))/2*a)

n=quadratic(a, b, c) print('方程的解为',n)


  • 1

Reply