程序中已有1个列表[“p”,“p”,“y”,“y”,“k”,“k”,“j”,“z”]
请编写程序,去掉列表中重复的内容,排序后,打印出来.
输入输出示例
ls=["p","p","y","y","k","k","j","z"]
s = set()
for item in ls:
s.add(item)
s = sorted(s)
for item in s:
print(item, end=' ')