7 Wed
2016๋
'''
https://programmers.co.kr/learn/courses/30/lessons/12901
2016๋
0. a์ b์ผ์ ์์ผ ๊ตฌํ๊ธฐ
1. datetime ์ฌ์ฉ
'''
import datetime
def solution(a, b):
answer = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
return answer[datetime.datetime(2016, a, b).weekday()]
'''
library ์ฌ์ฉ์ด ์๋์๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ด ํธ๋๊ฒ best์ธ ๋ฏ
def getDayName(a,b):
months = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
days = ['FRI', 'SAT', 'SUN', 'MON', 'TUE', 'WED', 'THU']
return days[(sum(months[:a-1])+b-1)%7]
'''
Last updated
Was this helpful?