How can this code be converted to a list comprehension?
pangram = "The quick brown fox jumps over the lazy dog"
lst = []
for char in pangram.casefold():
if char not in lst:
lst.append(char)
lst.sort()
print(''.join(lst))
I tried the following list comprehension but it is not working:
lst = [char for char in pangram.casefold if char not in lst]
It gives the following error
NameError: name 'lst' is not defined
Please suggest a solution.