x = 0 S = 400 while x < 20 : x = x + 1 S = 2 * x**2 - 40 * x + 400 if S == 272 : print(x)