• Why does assert throw an error?

Question related to mission Convert Date

 
def convert_date(date: str) -> str:
try:
    dd, mm, yyyy = date.split('/')
    assert (0 < int(dd) < 32) and (0 < int(mm) < 13) and (1900 <= int(yyyy) <= 2100)
    if int(mm) == 2 and int(yyyy) % 4 != 0:
        raise ValueError()
    return f'{yyyy}-{mm}-{dd}'
except:
    return 'Error: Invalid date.'>