# Python CodeRecipe|returnの使い方

Home Python Keywords

# returnの例1

Exit a function and return the sum:

    def myfunction():  return 3+3print(myfunction())

# returnの定義及び使い方

return関数は、関数を終了し、 値を返す。

# returnの例2

Statements after the return line will not be executed:

    def myfunction():  return 3+3  print("Hello, World!")
print(myfunction())

Related Pages Define a function using the keyword def. Read more about functions in our Python Functions Tutorial.

Home Python Keywords