-
함수를 변수처럼 전달하기Tech/Python 2019. 1. 6. 17:19반응형
"""
함수 인자값으로 함수전달하기
"""
def money_calculate(amount,exchange_rate_func):
tmp_val = exchange_rate_func(amount)
return tmp_val
def exchange_rate(amount):
return amount * 1.5
ret_val = money_calculate(1000000,exchange_rate)
print(ret_val)반응형'Tech > Python' 카테고리의 다른 글
python config file write and read with configparser (0) 2019.02.04 타입 힌팅 (0) 2019.01.06 python 다중 상속 (0) 2019.01.06 python class (0) 2019.01.03 python command line args (0) 2019.01.01