Output 2017 Premium Friday list in Python

(Wow! First post!)

Posted later than the first day of Premium Friday ...

List output on the last Friday of each month of 2017

lastfri.py


import calendar

def Last_FridayList(year):
 for month in range(1, 13):
  lastfri = max(week[calendar.FRIDAY]
   for week in calendar.monthcalendar(year, month))
  print('{:4d}-{:02d}-{:02d}'.format(year, month, lastfri))
Last_FridayList(2017)

with this, 2017-01-27 2017-02-24 2017-03-31 2017-04-28 2017-05-26 2017-06-30 2017-07-28 2017-08-25 2017-09-29 2017-10-27 2017-11-24 2017-12-29 Can be output as standard.

Recommended Posts

Output 2017 Premium Friday list in Python
Sorted list in Python
Filter List in Python
List find in Python
Japanese output in Python
Getting list elements in Python
Read Fortran output in python
[Python] How to output the list values in order
Extract multiple list duplicates in Python
Difference between list () and [] in Python
[python] Manage functions in a list
Sort and output the elements in the list as elements and multiples in Python.
Make standard output non-blocking in Python
Export and output files in Python
[Python] list
Delete multiple elements in python list
Data input / output in Python (CSV, JSON)
Output tree structure of files in Python
Display a list of alphabets in Python 3
OR the List in Python (zip function)
Difference between append and + = in Python list
Download images from URL list in Python
Summary of built-in methods in Python list
Get the EDINET code list in Python
[Python] Understand list slicing operations in seconds
Quadtree in Python --2
Python in optimization
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
Meta-analysis in Python
Unittest in python
python learning output
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
Plink in Python
Constant in python
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
Python> Comprehension / Comprehension> List comprehension
StepAIC in Python
N-gram in python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Constant in python
nCr in Python.
format in python
Scons in Python3
Puyo Puyo in python
python in virtualenv
PPAP in Python