Python checkio "The Most Frequent Weekdays"解决方案
来源:互联网 发布:js ajax post 编辑:程序博客网 时间:2024/06/05 07:41
判断一年中星期几出现的频率最高获取那一年第一周和最后一周,取出的交集就是出现频率最高的,如果没有交集,则取其并集def most_frequent_days(year): import calendar import datetime firstweek = set(range(datetime.datetime(year,1,1).weekday(),7)) lastweek = set(range(datetime.datetime(year, 12, 31).isoweekday())) return [calendar.day_name[day] for day in sorted((firstweek & lastweek)or (firstweek|lastweek))]
阅读全文
0 0
- Python checkio "The Most Frequent Weekdays"解决方案
- checkio the most frequent weekdays
- checkio-the most wanted letter
- CheckIO The Most Wanted Letter
- The Most Frequent Number
- Python checkio median解决方案
- Python checkio "Friends"解决方案
- BIT1006 The most frequent number
- Python checkio Monkey Typing解决方案
- Python checkio Pawn Brotherhood解决方案
- Python checkio Long Repeat解决方案
- Python checkio First Word解决方案
- Python checkio Secret Message解决方案
- Python checkio Index Power解决方案
- Python checkio Digits Multiplication解决方案
- Python checkio Days Between解决方案
- Python checkio Cipher map解决方案
- Python checkio Boolean Algebra解决方案
- 在vs2008,vs2013及以上visual studio中使用vim
- docker获取镜像仓库里所有镜像的脚本
- Ubuntu16.04 添加启动器和桌面快捷方式
- DHCP详细工作过程(转)
- Cinema 4D R19 Studio(3D创作软件)官方中文破解版VR19.024下载 | cinema 4d r19官方简体中文完整版
- Python checkio "The Most Frequent Weekdays"解决方案
- android在进行创建项目gen下没有自动生成R.java
- 数据结构-链队列代码实现
- HALCON形状匹配讲解
- USART_GetITStatus与 USART_GetFlagStatus的区别
- 【惊雷】Linux下rsync+inotify的实时文件自动同步
- JavaScript Functional Programming:组合函数 Composition
- 九年IT生涯回顾
- python面向对象(一)