title: How to check the date is empty using python?
body: <p>The <code>startdate</code> and <code>enddate</code> values are coming from jenkin to lambda.
  In this code I am trying to get value using <code>event["start_date"] and event["end_date"]</code> and it's working fine, but if <code>startdate</code> and <code>enddate</code> are not available then the code should automatically take today's and yesterday's date.</p>
  
  <p>I am new to python, can someone help here?</p>
  
  <p>I tried as below but I am getting error.
  If I will mention 'startdate and enddate is none' and set both values as none then it's working but I need to implement mentioned in code as I am using AWS lambda with python.</p>
  
  <pre><code>import datetime
  from datetime import timedelta
  
  dateformat = "%Y-%m-%d"
  startdate = datetime.datetime.strptime("", dateformat)
  enddate = datetime.datetime.strptime("", dateformat)
  # Both startdate and enddate values come from Jenkin to lambda  - 
  event["start_date"] and event["end_date"]
  if (startdate and enddate) == "":
      startdate = datetime.date.today()
      enddate = startdate - datetime.timedelta(days = 1)
      print('yesterday : ', enddate)  
      print('Today : ', startdate)
  </code></pre>
  
  <p>Current Error Output:</p>
  
  <pre><code>Traceback (most recent call last):
    File "variable_value_change.py", line 10, in &lt;module&gt;
      startdate = datetime.datetime.strptime("", dateformat)
    File "C:\Users\336635743\AppData\Local\Programs\Python\Python37-32\lib\_strptime.py", line 577, in _strptime_datetime
      tt, fraction, gmtoff_fraction = _strptime(data_string, format)
    File "C:\Users\336635743\AppData\Local\Programs\Python\Python37-32\lib\_strptime.py", line 359, in _strptime
     (data_string, format))
  ValueError: time data '' does not match format '%Y-%m-%d'
  </code></pre>