OK, here are a series of Python brainteasers based on this very special day for me.
Today is NOT my birthday but today is my 20,000th day on the planet. Here the clock has just struck midnight and now it is Sat. 23 Aug 2014. When I run the following Python program:
import datetime
def elapsed_datetime(start_datetime, end_datetime = datetime.datetime.now()):
return end_datetime - start_datetime # returns a datetime.timedelta
start_datetime = datetime.datetime(YYYY, MM, DD)
print(elapsed_datetime(start_datetime))
The result is: 20000 days, 0:03:55.788649.
Your mission (should you choose to accept it) is to create a Python program that generates a tuple of the following form: ("1999/12/16", "Mon/Tues/Sat/Thurs", 37)
- The first value in the tuple is the YYYY, MM, and DD of the day that I was born. These values will make the above program respond as it does above.
- The second value in the tuple is four days of the week for: the day that I was born, my 10,000th day (half my lifetime ago), today (hint:Sat), and my 30,000th day (if I am lucky enough to live that long).
- The third value in the tuple must be a prime number. It is my first age in years that is prime on or after my 30,000th day (if I am lucky enough to live that long).
HINT: Do not worry about the time of day, only worry about the date portion of datetime.