I am a rookie python programmer and I need to write a script to check if a given date (passed as a string in the form \'Month, day year\') is the third Friday of the month. I am
If you're trying to find the expiration of an option, you could use something like this
from datetime import datetime
import calendar
def option_expiration(date):
day = 21 - (calendar.weekday(date.year, date.month, 1) + 2) % 7
return datetime(date.year, date.month, day)
print option_expiration(datetime.today())