为什么在while循环中出现语法错误?

时间:2018-10-18 11:58:14

标签: python introduction

我在第11行中收到语法错误,我不明白。

T = int(raw_input())
L = []
for i in range(0,T):
    num = int(raw_input())
    L.append(num)
for b in L:
    n = 0
    sum = 0
    while b - (4 * n) > 0:
       term = (2 * (int(b/2)) - ((4 * n) + 3 )
       sum = sum + term
       n = n + 1
    print sum

1 个答案:

答案 0 :(得分:0)

您在以下位置缺少右括号:

term = (2 * (int(b/2)) - ((4 * n) + 3 )