Python check if object is dict code example
Example 1: check if is dictionary
isinstance(df, pd.DataFrame)
isinstance(df, dict)
isinstance(df, list)
Example 2: isinstance several variables
'check if variables days, months or years are all integers
if not all(isinstance(i, int) for i in [days, months, years]):