Python入門トップページ
関数から値を返したい場合は return を使う.
return
def tenTimes(x): """ 10倍返し """ return x * 10 y = tenTimes(4) print(y)
40
目次に戻る