How to find strings and put them in a list only once in python? -
I have some string in the list like:
a = ['Android' . Bros. "Android" Brosser URL 'Android' Messaging "FutureShop" FutureShop Filler "FutureShop" Filter Hello '' FutureShop. Test 'Test' Test. Hello ']
What do I have to do, get names of all these stars (Android, FutureShop, Test) and put them in a list. The list will then appear:
b = ['Android', 'FutureShop', 'Test']
i.e; There should not be a string more than once.
Edit / Note: I did not know about using the set in Python first, this is why I asked this question.
Well assume that they are in the list:
A = ['Android', 'Android. Bros. ',' Android. Brosser Url ',' android ' Messaging ',' FutureShop ',' FutureShop ' Filler ',' FutureShop. Filter Hello 'You can do this: b = list (set (set (set) (set (set (' set ',' test ',' test.Hello '] For example, I)); gt; print b ['test', 'android', for example iSplit ('.', 1) [0]). 'Futureship']
Comments
Post a Comment