-
[Python] 함수의 arguments에 함수를 던져보자Python 2021. 11. 25. 19:22
def message(): return "hello world" def letter(func): print("this is message") # 전달된 함수를 호출 print(func()) # 함수 자체를 전달 letter(message) ------------------------ => this is message hello world
'Python' 카테고리의 다른 글
[Python] dict 합치기 (merge) (0) 2021.12.15 [Python] .join() method 이용해서 간지나게 list 뜯어보기 (0) 2021.12.04 [Python] 지역변수들이 뭐가 있나 확인해보자 locals() (0) 2021.11.25 [Python] text를 index해보자 module : re (0) 2021.11.24 [Python] with문에 대해 알아보자 (실행과 종료) (0) 2021.11.24