无法通过不合逻辑的线pep8错误 [英] Can't get past illogical line pep8 error
本文介绍了无法通过不合逻辑的线pep8错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直试图解决这个问题一段时间,我只是无法让它通过pep8。
这是我的代码:
I've been trying to fix this for a while now and i just can't get it to pass pep8. Here is my code:
1。
if (len(regex) > 2 and regex[0] == '(' and regex[-1] == ')' and
sum(regex.count(char) for char in splitter) == 1 and
regex.count('(') == 1 and regex.count(')') == 1):
print('hi')
2。
if (len(regex) > 2 and regex[0] == '(' and regex[-1] == ')' and
sum(regex.count(char) for char in splitter) == 1 and
regex.count('(') == 1 and regex.count(')') == 1):
print('hi')
3。
if (len(regex) > 2 and regex[0] == '(' and regex[-1] == ')'
and regex.count('(') > 1):
print('hi')
我每次收到以下PEP8错误3 if语句:
I get the following PEP8 error on each of the 3 if statements:
E125 continuation line does not distinguish itself from next logical line
任何关于它有什么问题的想法?这些行用第一个括号缩进,所以我真的没有线索。
Any idea on what's wrong with it? The lines are indented with the first bracket so i really don't have a clue.
推荐答案
1。
if (len(regex) > 2 and regex[0] == '(' and regex[-1] == ')' and
sum(regex.count(char) for char in splitter) == 1 and
regex.count('(') == 1 and regex.count(')') == 1):
print('hi')
2。
if (len(regex) > 2 and regex[0] == '(' and regex[-1] == ')' and
sum(regex.count(char) for char in splitter) == 1 and
regex.count('(') == 1 and regex.count(')') == 1):
print('hi')
3。
if (len(regex) > 2 and regex[0] == '(' and regex[-1] == ')'
and regex.count('(') > 1):
print('hi')
这篇关于无法通过不合逻辑的线pep8错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文