coding_note
2019년 7월 22일 월요일
Is there a way to perform “if” in python's lambda
The syntax you're looking for:
lambda
x
:
True
if
x
%
2
==
0
else
False
But you can't use
print
or
raise
in a lambda.
댓글 없음:
댓글 쓰기
최근 게시물
이전 게시물
홈
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기