2018-03-01から1ヶ月間の記事一覧
print()とreturnについて 関数の定義でprint()とreturnどちらをつかうべきか? print()・・・表示するだけ return・・・戻り値を返す >>> def print_hello(): ... print("hello") ... >>> print_hello() hello >>> def return_hello(): ... return "hello" .…
print()とreturnについて 関数の定義でprint()とreturnどちらをつかうべきか? print()・・・表示するだけ return・・・戻り値を返す >>> def print_hello(): ... print("hello") ... >>> print_hello() hello >>> def return_hello(): ... return "hello" .…