datetime模块用来解有关日期的题非常好用 推荐去学一下
from datetime import datetime,timedelta n=int(input()) m=int(input()) a=datetime(2012,n,m) x=a.weekday() b={0:"Monday",1:"Tuesday",2:"Wednesday",3:"Thursday",4:"Friday",5:"Saturday",6:"Sunday"} print(b[x])