human
compare variable with type.
assistant
Here is a Python function to compare variables with type variables

def is_type(var, type):
    """Compare variable with type."""
    if type == "int":
        return isinstance(var, int)
    elif type == "float":
        return isinstance(var, float)
    elif type == "str":
        return isinstance(var, str)
    elif type == "bool":
        return isinstance(var, bool)
    else:
        return False

# Enter the variable
var = "str"

# Calling the function
print((is_type(var, "int")))

#Example Output
# False

#Remember to inspect code for bugs.