Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STEP 2. 조건문 #3

Open
7 tasks done
letsjo opened this issue Mar 29, 2023 · 0 comments
Open
7 tasks done

STEP 2. 조건문 #3

letsjo opened this issue Mar 29, 2023 · 0 comments
Assignees
Labels
STEP 단계

Comments

@letsjo
Copy link
Owner

letsjo commented Mar 29, 2023

단계 설명

if 등의 조건문을 사용해 봅시다.

문제 / 코드보기

새로 알게된 점

  • max() 으로 최대값을 찾을 수 있다.

     max([1,2,3]) # 3
  • lambda 라는 메서드가 있었는데, 사용해봐야겠다.

     # lambda 인수1, 인수2, ... : 인수를 이용한 표현식
     >>> sum = lambda a, b: a+b
     >>> sum(3,4)
     7
  • python 에서도 reduce는 있지만, python3부터 내부함수에서 빠져 라이브러리에서 가져와야 한다.

     from functools import reduce
     
     # reduce(function, iterable[, initializer])
     reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) # ((((1+2)+3)+4)+5)
@letsjo letsjo added the STEP 단계 label Mar 29, 2023
@letsjo letsjo self-assigned this Mar 29, 2023
@letsjo letsjo changed the title STEP 2. 입출력과 사칙연산 STEP 2. 조건문 Mar 29, 2023
letsjo added a commit that referenced this issue Mar 29, 2023
letsjo added a commit that referenced this issue Mar 29, 2023
letsjo added a commit that referenced this issue Mar 29, 2023
letsjo added a commit that referenced this issue Mar 29, 2023
letsjo added a commit that referenced this issue Mar 29, 2023
letsjo added a commit that referenced this issue Mar 29, 2023
letsjo added a commit that referenced this issue Mar 29, 2023
letsjo added a commit that referenced this issue Mar 29, 2023
letsjo added a commit that referenced this issue Mar 29, 2023
윤년 조건을 잘못 이해하고 입력했었는데, 답이 맞다고 나왔음
조건 수정 후 재업로드
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STEP 단계
Projects
None yet
Development

No branches or pull requests

1 participant