python 新手 一个简单的错误检查不出来
程序代码:
f = open('tmp.dump','r') lines = f.readlines( ) f.close() results = [ ] for line in lines: data = line.split( ) for atoms in data[1:6]: result1 = data[1] result2 = data[2] if result1 <10: result = result1 elif result2 <10: result =result2 ; print (result) results.append(result) output = open('result.txt','w') output.writelines(results) output.close( ) 运行的时候老是显示result这个地方错误,刚接触python不知道语法哪里错了