python3合并list并去重
最简单的是遍历,就不赘述了。下面介绍转成set 方法
转成 set
product_id_list = ['10047', '8156', '10788', '12']
current = ['1', '200', '10047', '34']
product_id_list.extend(current)
print(','.join(set(product_id_list)))
# 也可以这样写
product_ids = ','.join((item) for item in set(product_id_list))
print(product_ids)
python3合并list并去重
https://blog.puresai.com/2023/11/24/500/