找到N个自然数列表的缺失元素。 [第10和18行中的错误] [“ int”对象不可调用]
numTest = int(input(""))
n = 1
while n <= numTest:
numEle = int(input(""))
numEleList = list(map(int, input("").split()))
def fun(numEleList, numEle):
sumReq = int((numEle(numEle + 1)) / 2)
sumGiven = sum(numEleList)
reqNum = sumReq - sumGiven
return reqNum
print(fun(numEleList, numEle))
n += 1
答案 0 :(得分:0)
您忘记了*
line 10: numEle * (numEle + 1) / 2