这个计划严格规定在2014年。不过,我想知道我的方向是否正确。到目前为止,我得到的是:
def day(d,m): # Function for determining day name for a given date.
"""Where m is an integer from 1 through 12 expressing a month, and d is an integer from
1 through 31 expressing the day-part of a date in 2014."""
day = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
weekday = (d + (2.6*m - 0.2) -2*20 + 2014 + (2014//4) + (20//4))
return day[weekday]
Don't reinvent the wheel:
Or as a number:
^{pr2}$然后您可以将其传递到您的
day
列表中如果您不能使用
datetime
,则可以这样做:相关问题 更多 >
编程相关推荐