def greeting():
print('hello')
print('nice to meet you')
greeting()
こちらは、ふつうの関数😉
pythonでは、関数をオブジェクトとして扱える。
![]()
def double(func):
func()
func()
double(greeting)
同じ関数を二度呼び出しました。![]()
実行結果
hello
nice to meet you
hello
nice to meet you
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 3 years have passed since last update.
def greeting():
print('hello')
print('nice to meet you')
greeting()
こちらは、ふつうの関数😉
pythonでは、関数をオブジェクトとして扱える。
![]()
def double(func):
func()
func()
double(greeting)
同じ関数を二度呼び出しました。![]()
実行結果
hello
nice to meet you
hello
nice to meet you
Register as a new user and use Qiita more conveniently
Go to list of users who liked