how to check if a variable is complex in python code example Example: python check if number is complex >>> isinstance(1j, complex) True