No need for string interpolation here, just use `if not ismounted(device):`.