def var_to_list(var):
 if isinstance(var, list):
  return var
 if (not var):
  return []
 return [var]

def var_to_list ( var ) : if isinstance ( var , list ) : return var if ( not var ) : return [ ] return [ var ]
change the var to be a list .