Create a code that checks whether the given date is valid or not in Python.
Year: 2020
Month: 11
Day: 40
def validate_date(year, month, day):
    try:
        datetime.datetime(year, month, day)
        return True
    except ValueError:
        return False

validate_date(2020, 11, 40) # Output: False