A Python program I wrote to check whether a date is valid and then calculate the number of the day (out of a year).