Select the true statements related to PEP 8 naming conventions. (Select two answers.)
正解:A,D
Option A is true because PEP 8 recommends that function and variable names should be lowercase, with words separated by underscores . Option D is true because PEP 8 recommends that constants should be written in all capital letters with words separated by underscores . PEP 8は、Pythonコードの公式スタイルガイドです。読みやすく、一貫した命名規則に従うコードの書き方に関するガイドラインを提供します。PEP 8の目的は、Pythonコードの可読性を向上させ、理解しやすく、保守しやすくすることです。 PEP 8 によると、変数名と関数名は、A に記載されているように、単語をアンダースコアで区切ってすべて小文字で記述する必要があります。定数(コード全体で値が一定であると想定される変数)は、D に記載されているように、単語をアンダースコアで区切ってすべて大文字で記述する必要があります。 参考文献: PEP 8 -- Python コードのスタイルガイド: https://www.python.org/dev/peps/pep-0008/ Python ドキュメント: https://docs.python.org/3/tutorial/classes.html#classmethods-and-staticmethods