fork download
  1. # your code goes here
  2.  
  3. from datetime import date, timedelta
  4. from calendar import monthrange
  5.  
  6. days_in_month = lambda dt: monthrange(dt.year, dt.month)[1]
  7. today = date(year=2019, month=1, day=31)
  8. first_day = today.replace(day=1) + timedelta(days_in_month(today))
  9. print(first_day)
Success #stdin #stdout 0.02s 9724KB
stdin
Standard input is empty
stdout
2019-02-01