関数に説明を付けて取り出す
2022/1/30 2022/4/15

Pythonでは(ほかの言語同様に)関数の定義ができます。
その関数に説明文をつけ、それを専用の変数で取り出すことができます。
サンプルコード
def Say_Hello(argName = "John"):
"This is Say_Hello() function"
Base_Greeting = "Hi. How are you."
Greeting = Base_Greeting + " ," + argName
return Greeting
print(Say_Hello("Steve"))
print(Say_Hello.__doc__)
出力結果
>>>
*** Remote Interpreter Reinitialized ***
Hi. How are you. ,Steve
This is Say_Hello() function
簡単な説明
