すべてをまとめよう

Pythonの関数入門

Hugo Bowne-Anderson

Instructor

学んだこと:

  • 関数の書き方

    • 複数の引数を受け取る

    • 複数の値を返す

  • 次は:Twitterデータ分析用の関数

Pythonの関数入門

関数の基本要素

  • 関数ヘッダー
def raise_both(value1, value2):
  • 関数本体
    """Raise value1 to the power of value2
    and vice versa."""

    new_value1 = value1 ** value2          
    new_value2 = value2 ** value1

    new_tuple = (new_value1, new_value2)

    return new_tuple
Pythonの関数入門

演習に進みましょう

Pythonの関数入門

Preparing Video For Download...