python求助
查看原帖
python求助
1382040
Jarivs5272楼主2024/7/26 09:13
ss = input().split()
a = float(ss[0])
b = float(ss[1])
c = float(ss[2])
der = b**2-4*a*c
if der == 0:
    print(f'x1=x2={'{:.5f}'.format((-b)/2/a)}')
elif der <0:
    print('No answer!')
else:
    print(f'x1={'{:.5f}'.format((-b+(b**2-4*a*c)**(1/2))/2/a)};x2={'{:.5f}'.format((-b-(b**2-4*a*c)**(1/2))/2/a)}')

各位大佬,py小白,报的编译失败,为什么啊

print(f'x1=x2={'{:.5f}'.format((-b)/2/a)}')
             ^
SyntaxError: invalid decimal literal
2024/7/26 09:13
加载中...