• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > python显示生日是星期几的方法

python显示生日是星期几的方法

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了python 星期几,python判断星期几,python 星期,计算生日是星期几,党的生日是星期几等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

本文实例讲述了python显示生日是星期几的方法。分享给大家供大家参考。具体实现方法如下:

# 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)])

</div>

希望本文所述对大家的Python程序设计有所帮助。

</div>

您可能想查找下面的文章:

  • python根据日期返回星期几的方法
  • python显示生日是星期几的方法
  • python显示生日是星期几的方法

相关文章

  • Python 中迭代器与生成器实例详解
  • Python捕捉和模拟鼠标事件的方法
  • 详解Python中with语句的用法
  • 详解python的几种标准输出重定向方式
  • Python中的os.path路径模块中的操作方法总结
  • Python 专题三 字符串的基础知识
  • python爬取51job中hr的邮箱
  • python中私有函数调用方法解密
  • Python利用operator模块实现对象的多级排序详解
  • python获取远程图片大小和尺寸的方法

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Python中绑定与未绑定的类方法用法分析
    • 学习python处理python编码问题
    • python 写入csv乱码问题解决方法
    • python使用pyhook监控键盘并实现切换歌曲的功能
    • 深入理解Python中变量赋值的问题
    • Python实现的RSS阅读器实例
    • 跟老齐学Python之总结参数的传递
    • Python访问MySQL封装的常用类实例
    • Python获取央视节目单的实现代码
    • 跟老齐学Python之编写类之二方法

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有