最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python顯示生日是星期幾的方法

 更新時(shí)間:2015年05月27日 12:46:39   作者:依山帶水  
這篇文章主要介紹了python顯示生日是星期幾的方法,涉及Python使用date模塊操作日期的技巧,需要的朋友可以參考下

本文實(shí)例講述了python顯示生日是星期幾的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

# find the day of the week of a given date
# Python will trap impossible dates like (1900, 2, 29)
# tested with Python24   vegaseat  01aug2005
from datetime import date
# a typical birthday year, month, day 
# or change it to your own birthday... 
birthday = date(1983, 12, 25)
dayList = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
# date.weekday() returns 0 for Monday and so on, so pick the day string from the dayList
print "The day of the week on %s was a %s" % (birthday.strftime("%d%b%Y"), dayList[date.weekday(birthday)])

希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

遂川县| 泸定县| 仪征市| 师宗县| 福建省| 夏河县| 界首市| 皮山县| 乐安县| 垫江县| 五家渠市| 陇南市| 东兴市| 太白县| 嘉祥县| 平乐县| 惠来县| 呈贡县| 五指山市| 达拉特旗| 台东市| 嘉善县| 新化县| 宜阳县| 荥阳市| 龙川县| 柘城县| 七台河市| 广德县| 通化县| 游戏| 广河县| 和平县| 泰来县| 永丰县| 望都县| 林周县| 阜阳市| 博客| 泰顺县| 宁化县|