有时,Python中包含三元运算符的行会变得太长:
answer = 'Ten for that? You must be mad!' if does_not_haggle(brian) else "It's worth ten if it's worth a shekel."
是否有推荐的方法使用三元运算符将换行符设置为79个字符?我没有在PEP 8中找到它.
python line-breaks
line-breaks ×1
python ×1