def dict_to_ul(data, result=''): try: if not isinstance(data, dict): return data result += "" return result except Exception: return ''