• 회원가입
  • 로그인
  • 구글아이디로 로그인

[keyword] Python - lambda 키워드 - 작은 1회성 익명함수 (= 람다함수)

779  
lambda 예제

 

x = lambda a : a * 10

print(x(5))

 

결과값: 50

 

lambda 정의

 

작은 1회성 익명함수 생성. 더 자세히 보기

 


 

※ 독립변수는 다수 가능. 단, 표현식은 오직 1개여야 함.

※ 표현식은 계산 후, 결과는 return 사용 없이 바로 반환.

 

 

lambda 구문

 

lambda arg1, arg2, ... : expression


 

lambda 예제

 

x = lambda a, b, c : a + b + c

print(x(1, 2, 3))

 

결과값: 6

 


분류 제목
module Python - statistics.mode() 메서드 ★ - 최빈값 반환. (= mode메서드 = 모드)
module Python - statistics.pstdev() 메서드 -
module Python - statistics.stdev() 메서드 -
module Python - statistics.pvariance() 메서드 -
module Python - statistics.variance() 메서드 -
module Python - math 모듈 메서드・상수 종류 (※ 수학 모듈)
module Python - math.acos() 메서드 -
module Python - math.acosh() 메서드 -
module Python - math.asin() 메서드 -
module Python - math.asinh() 메서드 -
module Python - math.atan() 메서드 -
module Python - math.atan2() 메서드 -
module Python - math.atanh() 메서드 -
module Python - math.ceil() 메서드 ★ - 천장 반올림 (= 상위 정수로 반올림. = ceil메서드…
module Python - math.comb() 메서드 -
module Python - math.copysign() 메서드 -
module Python - math.cos() 메서드 -
module Python - math.cosh() 메서드 -
module Python - math.degrees() 메서드 -
module Python - math.dist() 메서드 -
19/24
목록
찾아주셔서 감사합니다. Since 2012