我想清理我的代碼,通過運行pylint與谷歌python風格rc文件的代碼。我只是想確認這是第一條打印線的正確風格,因爲它看起來很奇怪,但谷歌風格的rcfile顯示它是正確的風格。我知道,每行的長度不得超過80個字符如何在python中使用Google python style和pylint設計長線?
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("")
任何澄清,將不勝感激,謝謝
怎麼樣傳遞多個參數'打印()'?您不必爲彼此添加字符串。 –
我想在猜測和分數在同一行雖然在輸出 像這樣, 你的猜測和得分是:at____:0 –
'print(「a」,「b」,「c」)' >'abc' –