コードは正常に実行されますが、flake8 SyntaxError を解決できません。
コメントなしのコード
import math
def answer(str_n):
sume = ((str_n * (str_n + 1)) / 2) * math.sqrt(2)
sume = int(sume)
return sume
def answer1(str_n):
sume = 0
for i in range(str_n + 1):
sume += math.floor(i * math.sqrt(2))
# print i,math.floor(i*math.sqrt(2))
return sume
print "Test answer:", answer(77)
print "Actual answer:", answer1(77)