我正在尝试通过使用 google python 样式 rc 文件在其上运行 pylint 来清理我的分配代码。我只是想确认这是第一行打印的正确样式,因为它看起来很奇怪,但是 google 样式 rcfile 显示它是正确的样式。我知道每行的长度不能超过 80 个字符
for position, length in STEPS:
guess = prompt_guess(position, length)
score = compute_score(guess, position, word)
total = + total + score
print("Your guess and score were: " + ('_' * position + str(guess) +
('_' * (len(word) - length -
position))) + " : " +
str(score))
print("")
我会像这样格式化它:
for position, length in STEPS:
guess = prompt_guess(position, length)
score = compute_score(guess, position, word)
total = + total + score
print("Your guess and score were: " + ('_' * position + str(guess) +
('_' * (len(word) - length -position))) + " : " + str(score))
print("")
任何澄清将不胜感激,谢谢