Can you write an algorithm in Python to check if a given variable is palindrome?
def is_palindrome(variable):
  var = variable.lower()
  rev_var = var[::-1]
  if (var == rev_var):
    return True
  else:
    return False