Created
August 7, 2014 13:00
-
-
Save alexandre/fe68ccaa8538ec29a0b5 to your computer and use it in GitHub Desktop.
yet another code example...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| unpacking nested list | |
| ''' | |
| year = datetime.date.today().year | |
| month = datetime.date.today().month | |
| # My nested list | |
| cal = calendar.Calendar(6).monthdatescalendar(year, month) | |
| # damn! I just wanna a simple list... | |
| # hey wait... | |
| days = [day for week in cal for day in week] | |
| # =] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment