def func_a(month, day): month_list = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] total = 0; for i in range(month - 1): total += month_list[i] total += day return total - 1 def solution(startmonth, startday, endmonth, endday): starttotal = func_a(startmonth, startday) endtotal = func_a(endmonth, endday) return endtotal - starttotal startmonth = 1 startday = 2 endmonth = 2 endday = 2 ret = solution(startmonth, startday, endmonth, endday)
To embed this project on your website, copy the following code and paste it into your website's HTML: