coding:utf-8
a = 0
b = 0
while true:
if b>1000:
break
if b % 2 == 0:
b = b+a
a=a+1
print (b)
File "index.py", line 2 coding:utf-8 ^ SyntaxError: invalid syntax
前面少了一个#
应该是:
# coding=UTF-8