[프로그래머스/파이썬] Level 1 2016년

bye9·2021년 2월 22일
0

알고리즘(코테)

목록 보기
81/130

https://programmers.co.kr/learn/courses/30/lessons/12901


알고리즘 분류

  • 구현

문제풀이

규칙을 찾아 조건에 따라 구현하면 된다!

소스코드

def solution(a, b):
    array=["FRI","SAT","SUN","MON","TUE","WED","THU"]
    counts=[0,31,29,31,30,31,30,31,31,30,31,30,31]

    month=0
    day=0
    for i in range(a-1):
        month+=counts[i+1]
    day=b-1

    return(array[(month+day)%7])

0개의 댓글