Notice
Recent Posts
Recent Comments
Link
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Archives
Today
Total
관리 메뉴

RUBY

lambda함수 본문

프로그래밍 언어/Python

lambda함수

ruby-jieun 2023. 1. 7. 23:37

 

 

lambda함수

 


 

 

lambda

  • lambda 키워드를 이용하면 함수 선언을 보다 간단하게 할 수 있다.
def calculator(n1, n2):
    return n1 + n2

returnValue = calculator(10, 20)
print(f'returnValue: {returnValue}')
calculator = lambda n1, n2: n1 + n2
returnValue = calculator(10, 20)
print(f'returnValue: {returnValue}')

'프로그래밍 언어 > Python' 카테고리의 다른 글

실행(메인) 파일, 패키지  (0) 2023.01.07
모듈  (0) 2023.01.07
중첩함수  (0) 2023.01.07
지역변수와 전역변수  (0) 2023.01.07
데이터 반환  (0) 2023.01.07
Comments