[Python] Check Null or N/A or empty String
Sample function to check if string is None
or empty ""
or “N/A” or “-“
return true if str is not contains conditions.
def is_not_blank_or_na(str):
return bool(str and str.strip()) and not bool(str == 'N/A' or str == '-' or str.startswith(' ') or str == 'None' or str is None)
Comments