嵌套列表如何去重而顺序不变?

例如:
l = [['百度', 'BD'], ['京东', 'JD'], ['淘宝', 'TB'], ['百度', 'BD']]
如何实现去重后的结果
l = [['百度', 'BD'], ['京东', 'JD'], ['淘宝', 'TB']]

l = [['百度', 'BD'], ['京东', 'JD'], ['淘宝', 'TB'], ['百度', 'BD']]
output=[]
while(l):
    p = l.pop()
    if p in l:
        continue
    else:
        output.insert(0,p)
print(output)

d=dict(l)
l=list(d.items())
从python3.7开始,dict可以保证插入顺序有序,也即从list转为dict时,它的排序顺序与list相同

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632