Skip to content

Word Search#105

Open
tom4649 wants to merge 3 commits into
mainfrom
79.Word-Search
Open

Word Search#105
tom4649 wants to merge 3 commits into
mainfrom
79.Word-Search

Conversation

@tom4649
Copy link
Copy Markdown
Owner

@tom4649 tom4649 commented May 20, 2026

Comment thread 0079.Word-Search/step1.py
):
if (
0 <= row_next < num_row
and 0 <= col_next < num_col
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and は行末に書くこともあるようです。

参考までにスタイルガイドへのリンクを共有いたします。

https://google.github.io/styleguide/pyguide.html#32-line-length

Yes: if (width == 0 and height == 0 and
color == 'red' and emphasis == 'strong'):

なお、このスタイルガイドは“唯一の正解”というわけではなく、数あるガイドラインの一つに過ぎません。チームによって重視される書き方や慣習も異なります。そのため、ご自身の中に基準を持ちつつも、最終的にはチームの一般的な書き方に合わせることをお勧めします。

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

リンク先の記事によると、PEP 8では演算子の前に改行を行うことが推奨されているようです。ただし、2016年以前は演算子の後が推奨されていたようです。
https://rcmdnk.com/blog/2019/11/04/computer-python/
自分はこれに倣って以降演算子の前に改行を行うように書こうと思います。

自分は改行をフォーマッタに任せて意識していなかったので勉強になりました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants