Created
December 11, 2013 15:00
-
-
Save ruliarmando/7911838 to your computer and use it in GitHub Desktop.
This file contains 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
import datetime | |
month_placeholder = { | |
'Jan' : 1, | |
'Feb' : 2, | |
'Mar' : 3, | |
'Apr' : 4, | |
'Mei' : 5, | |
'Jun' : 6, | |
'Jul' : 7, | |
'Agu' : 8, | |
'Sep' : 9, | |
'Okt' : 10, | |
'Nov' : 11, | |
'Des' : 12, | |
} | |
def parse_indo_date(d): | |
s_date = d.split() | |
day = int(s_date[0]) | |
month = month_placeholder[s_date[1]] | |
year = int(s_date[2]) | |
return datetime.date(year, month, day) | |
indo_date = {} | |
for i in range(3): | |
i = raw_input('enter date-%d: ' % i) | |
indo_date[parse_indo_date(i)] = i | |
for d in sorted(indo_date.keys()): | |
print indo_date[d] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment