You know to flip the list:
a = ["hello", "hello", "hi", "hi", "hey"]
to list:
b = ["hello", "hi", "hey"]
You just do it like this:
b = list(set(a))
He is fast and pythonic.
But what if I need to include this list:
a = [["hello", "hi"], ["hello", "hi"], ["how", "what"], ["hello", "hi"],
["how", "what"]]
to:
b = [["hello", "hi"], ["how", "what"]]
What is the pythonic way to do this?
Shane source
share