尝试编写python代码来解决二次公式,遇到一些问题

问题描述

@Query("SELECT id FROM content_table")
fun getIds(): Flow<List<String>>

我真的不明白发生了什么,这是错误的图像 enter image description here

main.py:7: SyntaxWarning: 'int' 对象不可调用;也许你错过了一个逗号? d=math.sqrt((B**2)-4(A)(C))

解决方法

你必须明确地使用乘号。

import math
print("\nax^2+bx+c\n")
A=float(input("a: "))
B=float(input("b: "))
C=float(input("c: "))

d=math.sqrt((B**2)-4*A*C)
answerA=(-B-d)/2*A

answerB=(-B+d)/2*A

print("the answers are ",answerA,"and",answerB)