[Programmers] - 2016년 (Level 1)
연습문제
LEVEL : 1
a = 5
b = 24
def solution(a, b):
days = [31,29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
day = ['FRI', 'SAT', 'SUN', 'MON', 'TUE', 'WED', 'THU']
nday = 0
for i in range(a-1):
nday += days[i]
nday += b
answer = day[nday%7-1]
return answer
solution(a,b)
'TUE'
Comments