python列表编程题

已知列表 a_list =[4, 8, 7, 8, 6, 3,99,99,99,88,88,77,66,333,333,222], 编写程序删除列表中重复的数字(保留第一个),然后将其转化为字符串。(删除重复元素、列表转字符串)

暂时还不会

不知道如何下手

6634996787733388222

a_list =[4, 8, 7, 8, 6, 3,99,99,99,88,88,77,66,333,333,222]
new_lists = list(set(a_list))#先将列表转换为集合,因为集合是不重复的,故直接删除重复元素
str_new_lists = str(new_lists) #把列表转换为字符串

a_list = [4, 8, 7, 8, 6, 3, 99, 99, 99, 88, 88, 77, 66, 333, 333, 222]
new_list = list(set(a_list))
print(''.join(map(str, new_list)))

ans=sorted(list(set(a_list)),key=lambda x:a_list.index(x))
print(ans)
不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^